heraldry

package module
v0.0.0-...-07bf7ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2019 License: Apache-2.0 Imports: 9 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Heraldry Generator

A tool to generate random heraldry, written in Go.

The makearms command

The binary output of this program is a command makearms. You can use this program to generate random heraldry in SVG format.

It has the following options:

-html: Generates an HTML index page displaying each image and its blazon.

-results=N: Generates N devices. The default is 1.

-path=X: Outputs all files to X. Defaults to the current directory.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OrdinaryPale               = Charge{"pale", "pale", "pale", "pales", "", "a", false, []string{"ordinary"}}
	OrdinaryFess               = Charge{"fess", "fess", "fess", "fesses", "", "a", true, []string{"ordinary"}}
	OrdinaryCross              = Charge{"cross", "cross", "cross", "crosses", "", "a", true, []string{"ordinary"}}
	OrdinaryBend               = Charge{"bend", "bend", "bend", "bends", "", "a", true, []string{"ordinary"}}
	OrdinarySaltire            = Charge{"saltire", "saltire", "saltire", "saltires", "", "a", true, []string{"ordinary"}}
	OrdinaryChevron            = Charge{"chevron", "chevron", "chevron", "chevrons", "", "a", true, []string{"ordinary"}}
	OrdinaryChief              = Charge{"chief", "chief", "chief", "chiefs", "", "a", true, []string{"ordinary"}}
	OrdinaryPile               = Charge{"pile", "pile", "pile", "piles", "", "a", true, []string{"ordinary"}}
	OrdinaryPall               = Charge{"pall", "pall", "pall", "palls", "", "a", true, []string{"ordinary"}}
	OrdinaryBordure            = Charge{"bordure", "bordure", "bordure", "bordures", "", "a", true, []string{"ordinary"}}
	OrdinaryLozenge            = Charge{"lozenge", "lozenge", "lozenge", "lozenges", "", "a", false, []string{"ordinary"}}
	OrdinaryRoundel            = Charge{"roundel", "roundel", "roundel", "roundels", "", "a", false, []string{"ordinary"}}
	EagleDisplayed             = Charge{"eagle-displayed", "eagle displayed", "eagle", "eagles", "displayed", "an", false, []string{"animal"}}
	DragonPassant              = Charge{"dragon-passant", "dragon passant", "dragon", "dragons", "passant", "a", false, []string{"animal"}}
	GryphonPassant             = Charge{"gryphon-passant", "gryphon passant", "gryphon", "gryphons", "passant", "a", false, []string{"animal"}}
	FoxPassant                 = Charge{"fox-passant", "fox passant", "fox", "foxes", "passant", "a", false, []string{"animal"}}
	AntelopePassant            = Charge{"antelope-passant", "antelope passant", "antelope", "antelopes", "passant", "an", false, []string{"animal"}}
	AntelopeRampant            = Charge{"antelope-rampant", "antelope rampant", "antelope", "antelopes", "rampant", "an", false, []string{"animal"}}
	BatVolant                  = Charge{"bat-volant", "bat volant", "bat", "bats", "volant", "a", false, []string{"animal"}}
	Battleaxe                  = Charge{"battleaxe", "battleaxe", "battleaxe", "battleaxes", "", "a", false, []string{"weapon"}}
	BearHeadCouped             = Charge{"bear-head-couped", "bear's head couped", "bear's head", "bear's heads", "couped", "a", false, []string{"animal"}}
	BearRampant                = Charge{"bear-rampant", "bear rampant", "bear", "bears", "rampant", "a", false, []string{"animal"}}
	BearStatant                = Charge{"bear-statant", "bear statant", "bear", "bears", "statant", "a", false, []string{"animal"}}
	BeeVolant                  = Charge{"bee-volant", "bee volant", "bee", "bees", "volant", "a", false, []string{"animal"}}
	Bell                       = Charge{"bell", "bell", "bell", "bells", "", "a", false, []string{"instrument", "music"}}
	BoarHeadErased             = Charge{"boar-head-erased", "boar's head erased", "boar's head", "boar's heads", "erased", "a", false, []string{"animal"}}
	BoarPassant                = Charge{"boar-passant", "boar passant", "boar", "boars", "passant", "a", false, []string{"animal"}}
	BoarRampant                = Charge{"boar-rampant", "boar rampant", "boar", "boars", "rampant", "a", false, []string{"animal"}}
	BugleHorn                  = Charge{"bugle-horn", "bugle horn", "bugle horn", "bugle horns", "", "a", false, []string{"instrument", "music"}}
	BullPassant                = Charge{"bull-passant", "bull passant", "bull", "bulls", "passant", "a", false, []string{"animal"}}
	BullRampant                = Charge{"bull-rampant", "bull rampant", "bull", "bulls", "rampant", "a", false, []string{"animal"}}
	Castle                     = Charge{"castle", "castle", "castle", "castles", "", "a", false, []string{"structure"}}
	Cock                       = Charge{"cock", "cock", "cock", "cocks", "", "a", false, []string{"animal"}}
	Cockatrice                 = Charge{"cockatrice", "cockatrice", "cockatrice", "cockatrices", "", "a", false, []string{"animal"}}
	Crown                      = Charge{"crown", "crown", "crown", "crowns", "", "a", false, []string{"royalty"}}
	DolphinHauriant            = Charge{"dolphin-hauriant", "dolphin hauriant", "dolphin", "dolphins", "hauriant", "a", false, []string{"animal"}}
	DoubleHeadedEagleDisplayed = Charge{"double-headed-eagle-displayed", "double-headed eagle displayed", "double-headed eagle", "double-headed eagles", "displayed", "a", false, []string{"animal"}}
	DragonRampant              = Charge{"dragon-rampant", "dragon rampant", "dragon", "dragons", "rampant", "a", false, []string{"animal"}}
	EaglesHeadErased           = Charge{"eagles-head-erased", "eagle's head erased", "eagle's head", "eagle's heads", "erased", "an", false, []string{"animal"}}
	FoxSejant                  = Charge{"fox-sejant", "fox sejant", "fox", "foxes", "sejant", "a", false, []string{"animal"}}
	GryphonSegreant            = Charge{"gryphon-segreant", "gryphon segreant", "gryphon", "gryphons", "segreant", "a", false, []string{"animal"}}
	HareSalient                = Charge{"hare-salient", "hare salient", "hare", "hares", "salient", "a", false, []string{"animal"}}
	Hare                       = Charge{"hare", "hare", "hare", "hares", "", "a", false, []string{"animal"}}
	Heron                      = Charge{"heron", "heron", "heron", "herons", "", "a", false, []string{"animal"}}
	HorsePassant               = Charge{"horse-passant", "horse passant", "horse", "horses", "passant", "a", false, []string{"animal"}}
	HorseRampant               = Charge{"horse-rampant", "horse rampant", "horse", "horses", "rampant", "a", false, []string{"animal"}}
	LeopardPassant             = Charge{"leopard-passant", "leopard passant", "leopard", "leopards", "passant", "a", false, []string{"animal"}}
	LionPassant                = Charge{"lion-passant", "lion passant", "lion", "lions", "passant", "a", false, []string{"animal"}}
	LionRampant                = Charge{"lion-rampant", "lion rampant", "lion", "lions", "rampant", "a", false, []string{"animal"}}
	LionsHeadErased            = Charge{"lions-head-erased", "lion's head erased", "lion's head", "lion's heads", "erased", "a", false, []string{"animal"}}
	Owl                        = Charge{"owl", "owl", "owl", "owls", "", "an", false, []string{"animal"}}
	PegasusPassant             = Charge{"pegasus-passant", "pegasus passant", "pegasus", "pegasi", "passant", "a", false, []string{"animal"}}
	PegasusRampant             = Charge{"pegasus-rampant", "pegasus rampant", "pegasus", "pegasi", "rampant", "a", false, []string{"animal"}}
	RamRampant                 = Charge{"ram-rampant", "ram rampant", "ram", "rams", "rampant", "a", false, []string{"animal"}}
	RamStatant                 = Charge{"ram-statant", "ram statant", "ram", "rams", "statant", "a", false, []string{"animal"}}
	Rose                       = Charge{"rose", "rose", "rose", "roses", "", "a", false, []string{"plant"}}
	SeaHorse                   = Charge{"sea-horse", "sea horse", "sea horse", "sea horses", "", "a", false, []string{"animal"}}
	SerpentNowed               = Charge{"serpent-nowed", "serpent nowed", "serpent", "serpents", "nowed", "a", false, []string{"animal"}}
	Squirrel                   = Charge{"squirrel", "squirrel", "squirrel", "squirrels", "", "a", false, []string{"animal"}}
	StagLodged                 = Charge{"stag-lodged", "stag lodged", "stag", "stags", "", "a", false, []string{"animal"}}
	StagStatant                = Charge{"stag-statant", "stag statant", "stag", "stags", "", "a", false, []string{"animal"}}
	SunInSplendor              = Charge{"sun-in-splendor", "sun in splendor", "sun", "suns", "in splendor", "a", false, []string{"heavens"}}
	TigerPassant               = Charge{"tiger-passant", "tiger passant", "tiger", "tigers", "passant", "a", false, []string{"animal"}}
	TigerRampant               = Charge{"tiger-rampant", "tiger rampant", "tiger", "tigers", "rampant", "a", false, []string{"animal"}}
	Tower                      = Charge{"tower", "tower", "tower", "towers", "", "a", false, []string{"structure"}}
	TwoAxesInSaltire           = Charge{"two-axes-in-saltire", "two axes in saltire", "two axes", "two axes", "in saltire", "", false, []string{"weapon"}}
	TwoBonesInSaltire          = Charge{"two-bones-in-saltire", "two bones in saltire", "two bones", "two bones", "in saltire", "", false, []string{"weapon"}}
	UnicornRampant             = Charge{"unicorn-rampant", "unicorn rampant", "unicorn", "unicorns", "rampant", "a", false, []string{"animal"}}
	UnicornStatant             = Charge{"unicorn-statant", "unicorn statant", "unicorn", "unicorns", "statant", "a", false, []string{"animal"}}
	WolfPassant                = Charge{"wolf-passant", "wolf passant", "wolf", "wolves", "passant", "a", false, []string{"animal"}}
	WolfRampant                = Charge{"wolf-rampant", "wolf rampant", "wolf", "wolves", "rampant", "a", false, []string{"animal"}}
	Wyvern                     = Charge{"wyvern", "wyvern", "wyvern", "wyverns", "", "a", false, []string{"animal"}}
	AvailableCharges           = [68]Charge{OrdinaryPale, OrdinaryFess, OrdinaryCross, OrdinaryBend, OrdinarySaltire, OrdinaryChevron, OrdinaryChief, OrdinaryPile, OrdinaryPall, OrdinaryBordure, OrdinaryLozenge, OrdinaryRoundel, EagleDisplayed, DragonPassant, GryphonPassant, FoxPassant, AntelopeRampant, BatVolant, Battleaxe, BearHeadCouped, BearRampant, BearStatant, BeeVolant, Bell, BoarHeadErased, BoarPassant, BoarRampant, BugleHorn, BullPassant, BullRampant, Castle, Cock, Cockatrice, Crown, DolphinHauriant, DoubleHeadedEagleDisplayed, DragonRampant, EaglesHeadErased, FoxSejant, HareSalient, Hare, Heron, HorsePassant, HorseRampant, LeopardPassant, LionPassant, LionRampant, LionsHeadErased, Owl, PegasusPassant, RamRampant, RamStatant, Rose, SeaHorse, Squirrel, StagLodged, StagStatant, SunInSplendor, TigerPassant, TigerRampant, Tower, TwoAxesInSaltire, TwoBonesInSaltire, UnicornStatant, WolfPassant, WolfRampant, Wyvern}
)
View Source
var (
	Bend               = Division{"bend", "Per bend ", Tincture{}}
	BendSinister       = Division{"bendsinister", "Per bend sinister ", Tincture{}}
	Fess               = Division{"fess", "Per fess ", Tincture{}}
	Pale               = Division{"pale", "Per pale ", Tincture{}}
	Plain              = Division{"plain", "", Tincture{}}
	Quarterly          = Division{"quarterly", "Quarterly ", Tincture{}}
	Saltire            = Division{"saltire", "Per saltire ", Tincture{}}
	Chevron            = Division{"chevron", "Per chevron ", Tincture{}}
	AvailableDivisions = [8]Division{Bend, BendSinister, Fess, Pale, Plain, Quarterly, Saltire, Chevron}
)
View Source
var (
	Argent   = Tincture{"metal", "argent", "#FFFFFF"}
	Azure    = Tincture{"color", "azure", "#0000FF"}
	Erminois = Tincture{"fur", "erminois", "url(#erminois)"}
	Ermine   = Tincture{"fur", "ermine", "url(#ermine)"}
	Ermines  = Tincture{"fur", "ermines", "url(#ermines)"}
	Pean     = Tincture{"fur", "pean", "url(#pean)"}
	Gules    = Tincture{"color", "gules", "#EE0000"}
	Murrey   = Tincture{"stain", "murrey", "#591334"}
	Or       = Tincture{"metal", "Or", "#FFEC00"}
	Purpure  = Tincture{"color", "purpure", "#831CA6"}
	Sable    = Tincture{"color", "sable", "#000000"}
	Sanguine = Tincture{"stain", "sanguine", "#720101"}
	Tenne    = Tincture{"stain", "tenné", "#7C4215"}
	Vert     = Tincture{"color", "vert", "#009900"}
	Furs     = []Tincture{Erminois, Ermine, Ermines, Pean}
	Metals   = []Tincture{Or, Argent}
	Colors   = []Tincture{Sable, Gules, Vert, Azure, Purpure}
	Stains   = []Tincture{Murrey, Sanguine, Tenne}
)
View Source
var (
	Barry  = Variation{"barry", Tincture{}, Tincture{}}
	Bendy  = Variation{"bendy", Tincture{}, Tincture{}}
	Chequy = Variation{"chequy", Tincture{}, Tincture{}}
	Paly   = Variation{"paly", Tincture{}, Tincture{}}
)

Functions

func RenderToSVGFile

func RenderToSVGFile(device Device, fileName string, width int, height int)

RenderToSVGFile renders a device as SVG and writes to fileName

Types

type Charge

type Charge struct {
	Identifier string
	Name       string
	Noun       string
	NounPlural string
	Descriptor string
	Article    string
	SingleOnly bool
	Tags       []string
}

Charge is a charge

type ChargeGroup

type ChargeGroup struct {
	Charges []Charge
	Tincture
}

ChargeGroup is a group of charges with a common tincture

type Device

type Device struct {
	Field
	ChargeGroups []ChargeGroup
	AllTinctures []Tincture
}

Device is the entire coat of arms

func Generate

func Generate() Device

Generate procedurally generates a random heraldic device and returns it.

func (Device) RenderToBlazon

func (device Device) RenderToBlazon() string

RenderToBlazon renders a device as its blazon and returns it.

func (Device) RenderToSVG

func (device Device) RenderToSVG(width int, height int) string

RenderToSVG renders a device as SVG and outputs as a string

type Division

type Division struct {
	Name   string
	Blazon string
	Tincture
}

Division is a division of the field

type Field

type Field struct {
	Division
	Tincture
	HasVariation bool
	Variation
}

Field is the field of a coat of arms

type Tincture

type Tincture struct {
	Type    string
	Name    string
	Hexcode string
}

Tincture is a tincture

type Variation

type Variation struct {
	Name      string
	Tincture1 Tincture
	Tincture2 Tincture
}

Variation is a variation of the field

Directories

Path Synopsis
cmd
armsapi command
makearms command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址