diff options
author | kaa <kaa@disroot.org> | 2025-07-27 17:58:54 -0700 |
---|---|---|
committer | kaa <kaa@disroot.org> | 2025-07-27 17:58:54 -0700 |
commit | df0678382d5f1e4638ca0d29cf7984d756bc3249 (patch) | |
tree | 3c71ba5aa518d2b6b9e174aed65aceddd25ae12d | |
parent | 443c9ebd10fc9968ac385ab584f968f282813a31 (diff) |
Font metadata, translations.
-rw-r--r-- | lib/translate/translate.go | 362 |
1 files changed, 362 insertions, 0 deletions
diff --git a/lib/translate/translate.go b/lib/translate/translate.go index c2cb5d5..7ce49ab 100644 --- a/lib/translate/translate.go +++ b/lib/translate/translate.go @@ -1 +1,363 @@ package translate + +import ( + "pgset/lib/parse" + "fmt" + "io" +) + +func a(language string) string { + return "" +} + +func img(language string) string { + return "" +} + +func header(language string) string { + return "" +} + +func footer(language string) string { + return "" +} + +// Among all languages, these are defined: +// * Prefix: What should come before a string of body text +// * Postfix: What should come after a string of body text +// * Header: Start of document +// * Footer: End of document +// Maps for these tags, beginning and end if non-empty: +// * a: anchors to bookmarks and urls, switch on attribute +// * img: images +// * p: paragraphs +// * meta: metadata +// * h{1,2,3,4,5}: headings +// * strong, i: emphasis +// * table, tbody, tr, td: Table of Contents +// * div: chapter separations +// * br: line breaks +// All other tags are ignored. +// * span: Unwanted metadata, contents to be consumed +var Definitions = map[string]map[string]any { + "ConTeXt": { + // Must generate. + "a": a, + "/a": ``, + "meta": meta , + "/meta": ``, + "div": div, + "/div": ``, + // img tags are empty + "img": img, + "Header": header, + "Footer": footer, + + // Constants. + "p": ``, + "/p": ``, + "i": ``, + "/i": ``, + "strong": ``, + "/strong": ``, + "table": ``, + "/table": ``, + "tr": ``, + "/tr": ``, + "tbody": ``, + "/tbody": ``, + "td": ``, + "/td": ``, + "h1": ``, + "/h1": ``, + "h2": ``, + "/h2": ``, + "h3": ``, + "/h3": ``, + "h4": ``, + "/h4": ``, + "h5": ``, + "/h5": ``, + // br tags are empty + "br": ``, + "Prefix": ``, + "Postfix", ``, + }, + "kerTeX": { + }, + "XeTeX": { + }, + "LaTeX memoir": { + }, + "Neatroff": { + }, + "Utmac": { + }, + "groff": { + }, + "Heirloom Troff": { + }, + "SILE": { + }, + "Typst": { + }, +} + +// These keys defined: +// * "paper size" +// * "type family" +// * "columns" +// * "justification" +// * "margins" +// * "headers" +// * "page numbers" +var Styles = map[string]map[string]map[string]any { + "Margins": { + "Neatroff": { + "Wide": ``, + "Thin": ``, + }, + "ConTeXt": { + }, + }, +} + +// Across literature, there are fonts used for: +// * Display (h1) +// * Subheadings (h2, h3) +// * Text (h4, h5) +// * Small text (p) +// Following the nomenclature by Frank Grießhammer of Adobe. +// https://community.adobe.com/t5/adobe-fonts-discussions/optical-size-range-for-source-serif-4/m-p/14397175#M9797 +var Families = map[string]map[string]map[string]string { + "Adobe": { + "Source Serif": { + "Author": "Frank Grießhammer", + "About": `Source Serif (known as Source Serif Pro before 2021) is a serif typeface created by Frank Grießhammer for Adobe Systems. It is the third open-source font family from Adobe, distributed under the SIL Open Font License. +The typeface is inspired by the forms of Pierre Simon Fournier and is a complementary design to the Source Sans family. It is available in six weights in upright styles and italics, and five optical sizes. It is also available as a variable font with continuous weights from 200 to 900. +The first version, named "Source Serif Pro", was released in 2014. Version 2.0 was released in 2017 and introduced support for more Latin characters, Cyrillic, and Greek. In 2018, Latin italics were added in version "2.007R-ro/1.007R-it". In 2019, Greek and Cyrillic italic were added in version "3.000R".[10] In 2021, a new release added optical sizes; the name "Pro" was dropped at this point. See https://en.wikipedia.org/wiki/Source_Serif_4 for more.`, + "Source": "https://github.com/adobe-fonts/source-serif", + }, + "Source Sans": { + "Author": "Paul Hunt", + "About": `Source Sans (known as Source Sans Pro before 2021) is a sans-serif typeface created by Paul D. Hunt, released by Adobe in 2012. It is the first open-source font family from Adobe, distributed under the SIL Open Font License. +The typeface is inspired by the forms of the American Type Founders' gothics by Morris Fuller Benton, such as News Gothic, Lightline Gothic and Franklin Gothic, modified with both a larger x-height and character width and more humanist-influenced italic forms. It is available in seven weights (Regular, ExtraLight, Light, Medium, Semibold, Bold, Black) in upright and italic styles, and is also available as a variable font with continuous weight values from 200 to 900. The typeface has wide language support for Latin script, including Western and Eastern European languages, Vietnamese, pinyin romanization of Chinese, and Navajo. Adobe's training material highlights it as having a more consistent colour on the page than the rather condensed News Gothic it is based on. See https://en.wikipedia.org/wiki/Source_Sans_3 for more.`, + "Source": "https://github.com/adobe-fonts/source-sans", + }, + "Erewhon": { + "Author": "Michael Sharpe", + "About": `Erewhon is a font package based largely on Andrey V. Panov’s Heuristica, but with so many changes that it is no longer strictly compatible with that package, and is offered instead as an enhanced alternative. (Heuristica extended the Utopia font family made available by the TEX Users’ Group, adding many accented glyphs, Cyrillic glyphs, liga- tures, superior and oldstyle fixed-width figures in all styles, and Small Caps in Regular style only. It is widely distributed as a free font collection in OpenType, TrueType and Type1 formats.) See https://mirrors.ibiblio.org/pub/mirrors/CTAN/fonts/erewhon/doc/erewhon-doc.pdf for more.`, + "Source": `https://ctan.org/tex-archive/fonts/erewhon`, + }, + }, + "CTAN": { + "Cochineal": { + "Author": "Michael Sharpe", + "About": `Cochineal is a fork from the Crimson fonts (Roman, Italic, Bold, BoldItalic only) released under the OFL by Sebastian Kosch. These remarkable fonts are inspired by the famous oldstyle fonts in the garalde family (Garamond, Bembo) but, in the end, look more similar to Minion, though with smaller xheight and less plain in detail. See https://ctan.org/pkg/cochineal for more.`, + "Source": `https://ctan.org/pkg/cochineal`, + }, + "ETbb": { + "Author": `Michael Sharpe`, + "About": `Based on Daniel Benjamin Miller’s XETBook, which expanded Tufte’s ETBook, the family name for the Bembo-like font family he commissioned for his books, ETbb expands its features to include a full set of figure styles, small caps in all styles, superior letters and figures, inferior figures, a new capital Sharp S with small caps. See https://ctan.org/pkg/etbb for more.`, + "Source": `https://ctan.org/pkg/etbb`, + }, + }, + "ANRT": { + "Gotico-Antiqua Hamlet-Tertia18": { + "Author": "Rafael Ribas & Alexis Faudot", + "About": `Hamlet (also named Kessler-Blackletter), designed by Edward Johnston, cut in three sizes (10, 12 and 18 pt) by Edward Prince for William Shakespeare’s Hamlet. Published by Harry Kessler’s Cranach Press in Weimar in 1929. The type is based on the Durandus for the lowercases, and Sweynheim & Pannartz’ Subiaco type for the capitals. The type was used for trials in other books, none of which were completed. Type design workshop at Bauhaus Universität Weimar and Anna Amalia Bibliothek Weimar, January 2018. See https://gotico-antiqua.anrt-nancy.fr/en for more.`, + "Source": "https://github.com/anrt-type/GoticoAntiqua", + }, + "Gotico-Antiqua Jessen-Mittel14": { + "Author": "Rafael Ribas & Alexis Faudot", + "About": `Jessen, hybrid of gothic minuscules and roman capitals designed and cut without preliminary drawings in Offenbach am Main by Rudolf Koch for The Four Gospels. Printed at the Klingspor press in 1926 and published by Koch himself. Formerly named Bibel-Gotisch, the type was released as Jessen in several sizes by the Klingspor foundry in 1930. Type design workshop at ESAD•Valence, April 2016. See https://gotico-antiqua.anrt-nancy.fr/en for more.`, + "Source": "https://github.com/anrt-type/GoticoAntiqua", }, + "Gotico-Antiqua Ptolemy-GreatPrimer18": { + "Author": "Rafael Ribas & Alexis Faudot", + "About": "Ptolemy, designed in Chelsea by St John Hornby, Sidney Cockerell and Emery Walker, cut in 18 pt by Edward Prince for Cervantes’ Don Quixote. Published by the Ashendene Press in 1927. The type used until 1935 is a revival of Lienhart Holl’s cut for Ptolemaeus’ Cosmographia printed in 1482 in Ulm. Type design workshop at HEAR Mulhouse, March 2015. See https://gotico-antiqua.anrt-nancy.fr/en for more.", + "Source": "https://github.com/anrt-type/GoticoAntiqua", + }, + "Gotico-Antiqua SouffletVert": { + "Author": "Rafael Ribas & Alexis Faudot", + "About": "Soufflet Vert 106R, Hybrid first used in Paris by the Au Soufflet Vert workshop for Guido de Monte Rochen’s Manipulus curatorum, 1476 and used until 1480. Type design workshop at ISBA Besançon and Bibliothèque d’étude et de conservation de Besançon, May 2018. See https://gotico-antiqua.anrt-nancy.fr/en for more.", + "Source": "https://github.com/anrt-type/GoticoAntiqua", + }, + "Gotica-Antiqua Spira": { + "Author": "Rafael Ribas & Alexis Faudot", + "About": "Spira 110R, Proto-Roman first used in Venice by Johannes and Vindelinus de Spira for Cicero’s Epistolae ad familiares in 1469 and used until 1473 by Vindelinus. Type design workshop at ENSBA Lyon and Bibliothèque municipale de Lyon, March 2017. See https://gotico-antiqua.anrt-nancy.fr/en for more.", + "Source": "https://github.com/anrt-type/GoticoAntiqua", + }, + "Gotico-Antiqua Zainer": { + "Author": "Rafael Ribas & Alexis Faudot", + "About": "Zainer 96G, Gotico-Antiqua first used in Ulm by Johann Zainer for Jacques de Voragine’s Legenda aurea not after 1477 and used until 1485. Type design workshop at Hochschule Aachen and Stadtbibliothek Aachen, October 2017. See https://gotico-antiqua.anrt-nancy.fr/en for more.", + "Source": "https://github.com/anrt-type/GoticoAntiqua", + }, + "Gotico-Antiqua Hamlet-Cicero12": { + "Author": "Rafael Ribas & Alexis Faudot", + "About": "Hamlet (also named Kessler-Blackletter), designed by Edward Johnston, cut in three sizes (10, 12 and 18 pt) by Edward Prince for William Shakespeare’s Hamlet. Published by Harry Kessler’s Cranach Press in Weimar in 1929. The type is based on the Durandus for the lowercases, and Sweynheim & Pannartz’ Subiaco type for the capitals. The type was used for trials in other books, none of which were completed. Type design workshop at Bauhaus Universität Weimar and Anna Amalia Bibliothek Weimar, January 2018. See https://gotico-antiqua.anrt-nancy.fr/en for more.", + "Source": "https://github.com/anrt-type/GoticoAntiqua", + }, + "Gotico-Antiqua Rusch-R-Bizarre": { + "Author": "Rafael Ribas & Alexis Faudot", + "About": `Rusch ‘R-Bizarre’ 103R, Proto-Roman first used in Strasbourg by Adolf Rusch for Raban Maur’s De universo between 1467-74 (exact date unknown) and used until 1475. Type design workshop at ESAL Metz and Bibliothèque municipale de Metz, April 2018. See https://gotico-antiqua.anrt-nancy.fr/en for more.`, + "Source": "https://github.com/anrt-type/GoticoAntiqua", + }, + "Baskervvile": { + "Author": "Rosalie Wagner", + "About": `Baskervville is a revival of Jacob's Baskerwille, itself revived from Baskerville's typeface. It was distributed by Berger-Levrault Foundry from 1815. The font Jacob produced was sold as a "Caractères dans le genre Baskerwille" i.e "Baskerwille fonts alike" — with a w instead of a v. +The particularity of Jacob's Baskerwille is that the roman is very closed to Baskerville's typefaces while the italic is closer to Didot's typefaces. The workshop aimed to digitalized Jacob's font in order to testify to his work which creates a transition between transitional and modern styles. +The sources showed obvious inaccuracies due to the difficulty of producing and printing types in the 19th century. We didn't want to parody an historical typeface which would have reproduced irregularities from the paper, the ink nor the machine. So we tried to be true to what we thought were Jacob's purposess while using contemporary tools. However, we wanted to be able to use the font and for that matter we corrected some letter-shapes and proportions. We also had to guess the design of missing letters. +We kept that unusual w, which is twice a v, and made it the identity of Jacob's font. Jacob's Baskerwille is a strange double of Baskerville's typefaces; a "clone" which looks alike but which is not as achieved as its predecessor. This elementary duplication of the letter v signals, in a way, the counterfeiting. +See https://github.com/anrt-type/ANRT-Baskervville for more.`, + "Source": "https://github.com/anrt-type/ANRT-Baskervville", + }, + }, + "SIL": { + "Gentium": { + "Author": "Victor Gaultney", + "About": `"Gentium" is a Latin word meaning belonging to the nations. The Gentium typeface family was created to enable the diverse ethnic groups—nations—around the world who use the Latin, Cyrillic, or Greek scripts to produce readable, high-quality publications. It supports almost the complete range of Unicode characters for these scripts, including a comprehensive range of diacritics and a large set of symbols useful for linguistics and literacy work. +Gentium’s design is intended to be highly readable, reasonably compact, and visually attractive. One design strategy for greater readability is to make slightly more generous counters, which are the spaces inside and around the strokes of the letters. For compactness, capital letters are modest in size and slightly compressed. For attractiveness, Gentium combines good design with careful letterspacing, plus a friendly, calligraphic character. +The Gentium family is a complete Greek font, supporting both monotonic and polytonic forms. While some Greek characters do closely resemble Latin ones, it is a separate design that embraces the robust, distinctive character of the Greek script, but does so within the design context of the whole typeface. As a result, the two scripts can be successfully mixed in a paragraph or page of text. +See https://software.sil.org/gentium/ for more.`, + "Source": `https://github.com/silnrsi/font-gentium`, + }, + }, + "Bitstream": { + "Charter": { + "Author": "Matthew Carter", + "About": `Bitstream Charter is a serif typeface designed by Matthew Carter in 1987 for Bitstream Inc. Charter is based on Pierre-Simon Fournier’s characters, originating from the 18th century. Classified by Bitstream as a transitional-serif typeface (Bitstream Transitional 801), it also has features of a slab-serif typeface and is often classified as such. +Charter was originally optimized for printing on the low-resolution 300 dpi laser printers of the 1980s, and remains suitable for printing on both modern high-resolution laser printers and inexpensive lower resolution inkjet printers due to its strong, legible design. Its structure was optimised for low-memory computers and printers. In a 2013 interview, Carter explained that it used "a very simplified structure and a minimum number of curves, more straight-line segments... very economical compared to, say, Times New Roman," but noted that rapid development of printers made this unnecessary even before he had finished the design. In its simplification of serif forms, it foreshadowed Carter's later landmark design, Georgia for Microsoft. +In 1992 Bitstream donated a version of Charter, along with its version of Courier, to the X Consortium under terms that allowed the font to be modified and redistributed. This has resulted in open source derivatives of Bitstream Charter, including Charis SIL. Typographer Matthew Butterick considers Bitstream Charter to be one of the best free fonts available. See https://en.wikipedia.org/wiki/Bitstream_Charter for more.`, + "Source": `https://www.x.org/releases/individual/font/font-bitstream-type1-1.0.4.tar.xz`, + }, + "XCharter": { + "Author": `Michael Sharpe`, + "About": `The package presents an extension of Bitstream Charter, which provides small caps, oldstyle figures and superior figures in all four styles. See https://ctan.org/pkg/xcharter for more.`, + "Source": `https://ctan.org/pkg/xcharter`, + }, + }, + "Paratype": { + "PT Serif": { + "Author": `Alexandra Korolkova`, + "About": `The PT Serif type family consists of six styles. PT Serif Regular, PT Serif Bold, PT Serif Italic, and PT Serif Bold Italic are the four basic styles that can be successfully used in designing documents, just like basic styles of the PT Sans font. Besides that, these four basic styles are a perfect choice for fiction and non-fiction, illustrated magazines, newspapers, religious texts, and other texts where using sans-serif fonts is inappropriate for cultural or aesthetic reasons. +The type family also includes two styles with extended proportions. These styles are used for small-size characters of the PT Serif Caption Regular and PT Serif Caption Italic fonts, but here they are represented as upright and italic styles, which mainly suit those publications that use Antiqua fonts. The development of small-size styles required significant changes in the basic design; thus, a new design with features of a slab serif font emerged. One of the important user characteristics of both type families is the high quality of text displayed on low-resolution raster output devices, especially computer screens. This becomes crucial, given the development of technology for direct access to information resources from state programs such as E-Russia, e-government, etc. This ergonomic requirement, in addition to specific technical limitations to the design of the character contour, entailed much manual work in presenting the pixelated font in a wide range of sizes. Thus, the fonts are designed both for printing needs and for intensive paperless use not only on computer screens but also on digital signage, interactive information kiosks, the interfaces of portable communication devices, the small screens of household appliances, etc. +See https://web.archive.org/web/20200525033605/https://company.paratype.com/pt-sans-pt-serif and https://www.myfonts.com/pages/newsletters-cc-201410 for more.`, + "Source": `https://web.archive.org/web/20200525033605/https://company.paratype.com/system/attachments/634/original/ptserif.zip`, + }, + }, + "Google": { + "Crimson Pro": { + "Author": `Jacques Le Bailly`, + "About": `Crimson Pro is a serif typeface family: Contemporary, clear, classic and rounded/open. Something for a college textbook, editorial websites and any reading experience with book-length texts It contributes to the tradition of beautiful Garamond-inspired typefaces, often called “Garalde” or “Old Style,” and has 8 named weights, in Roman and Italic, and is available as a Variable Font with a Weight axis. +The first Crimson design was initiated by Sebastian Kosch in 2009, and he later completely redrew a new version called Crimson Prime. Google commissioned Jacques Le Bailly to review both typefaces, and develop Crimson Pro as a new design that synthesises both designs into a final authoritative family, first released in January 2019. All decisions were made to enable better readability for longer texts and the ability to make good and diverse typography. +The Crimson Pro project is led by Jacques Le Bailly, a type designer based in Den Haag, Netherlands. See https://fonts.google.com/specimen/Crimson+Pro/about for more.`, + "Source": `https://github.com/Fonthausen/CrimsonPro`, + }, + }, + "URW": { + "Domitian": { + "Author": `Daniel Miller`, + "About": `The Domitian fonts are a free and open-source OpenType font family, based on the Palatino design by Hermann Zapf (1918-2015), as implemented in Palladio (also known as p052), the version distributed as part of urw’s free Core 35 PostScript fonts (version 2.0, 2015). +Domitian is meant as a drop-in replacement for Adobe’s version of Palatino. It extends Palladio with small capitals, old-style figures and scientific inferiors. The metrics have been adjusted to more closely match Adobe Palatino, and hinting has been improved. +See https://mirrors.mit.edu/CTAN/fonts/domitian/doc/domitian-doc.pdf for more.`, + "Source": `https://github.com/dbenjaminmiller/domitian`, + }, + "RW Garamond": { + "Author": `Daniel Miller`, + "About": `RW Garamond is a freeware Garamond font in OpenType format. (‘RW’ stands for Rudolf Wolf, the designer who created Stempel's version of Garamond from the Egenolff-Berner specimen.) + +Features +------------ +* Ligatures +* Lining and Old-Style Figures +* Small caps for all styles +* Some alternates (use OpenType features for character variants 1–4) +RW Garamond is a modified version of URW Garamond No. 8. and GaramondX, with changes being made to support OpenType. +© 2000, 2014, (URW)++ Design & Development. +© 2005, Ralf Stubner. +© 2009, Gaël Varoquaux. +© 2012–2017, Michael Sharpe. +© 2019, Daniel Benjamin Miller. +See https://github.com/dbenjaminmiller/rwgaramond for more.`, + "Source": `https://github.com/dbenjaminmiller/rwgaramond`, + }, + "ScholaX": { + "Author": "Michael Sharpe", + "About": `ScholaX has a text part and a math support part that is called with an option to newtxmath. The text component has many of the options and macros that are part of the newtxtext package, but with Times fonts replaced by TeXGyreScholaX fonts, the latter being an an extension of the TeXGyreSchola fonts which in turn extended the URW rendering of New Century Schoolbook that was donated as open source to the Ghostscript project. The font is based on early nineteenth century “Scotch” type, whose dominant features are low contrast as compared to, say, Times and Baskerville, and a relatively tall x-height. Its revivals gained popularity because of studies indicating its readability by children leading to its adoption in many texts for that market. See https://mirrors.rit.edu/CTAN/fonts/scholax/doc/scholax-doc.pdf for more.`, + "Source": `https://ctan.org/pkg/scholax`, + }, + }, + "Tiro Typeworks": { + "Brill": { + "Author": "John Hudson", + "About": `The main characteristics of the Brill typeface are: +• A neo-classical design geared towards optimum legibility, even when heavy use is made of diacritics; +• Greek and Cyrillic matched and balanced with the Latin character shapes; +• A huge character set, covering all of the Latin ranges of the Unicode Standard, in several different styles; +• Extensive support for linguistic specials, including all of ipa; +• All of Unicode’s combining diacritical marks can be added to any base character, with automatically adjusted positioning and unlimited stacking of diacritics; +• A massive amount of punctuation marks and editorial and other symbols; +• Complete coverage of Ancient Greek, including metrical, papyrological and epigraphic characters; +• Coverage of Cyrillic (Slavic languages); +• Extended typographic features, such as true small caps, standard and discretionary ligatures, glyph variants for some characters, ranging and old-style numerals – both proportional and tabular –, special superior and inferior forms of numerals, etc. (some advanced OpenType features may require the use of high-end software like Adobe InDesign). +See https://brill.com/fileasset/downloads_static/static_typefacebrill_brilltypefacebrochure_2011.pdf for more.`, + "Source": `https://brill.com/page/resources_brilltypeface/brill-typeface`, + }, + }, + "Huerta Tipográfica": { + "Alegreya": { + "Author": `Juan del Peral`, + "About": `The Alegreya type system is a super family, originally intended for literature, and includes sans and serif sister families. Among its chroning characteristics, it conveys a dynamic and varied rhythm which facilitates the reading of long texts. Also, it provides freshness to the page while referring to the calligraphic letter, not as a literal interpretation, but rather in a contemporary typographic language. +The italic has just as much care and attention to detail in the design as the roman and make[s] a strong emphasis in the paragraph. The bold weights are strong, and the Black weights are really experiemental for the genre. +Not only does Alegreya provide great performance, but also achieves a strong a harmonious text by means of elements designed in an atmosphere of diversity. +Alegreya was chosen as one of 53 “Fonts of the Decade” at the ATypI Letter2 competition in September 2011 and prized with the Certificate of excellence at the Latinoamerican Tipos Latinos 2012 biennial. It was also selected in the 2nd Bienal Iberoamericana de Diseño, competition held in Madrid in 2010. +It suports expert latin, greek, and cyrillic character sets and provides advanced typography OpenType features such as small caps, dynamic ligatures and fractions, four sets of figures, super and subscript characters, ordinals, localized accent forms for spanish, catalan, guaraní, dutch, turkish, romanian, serbian among others. +See https://huertatipografica.com/en/fonts/alegreya-ht-pro for more.`, + "Source": `https://github.com/huertatipografica/Alegreya`, + }, + "Piazzola": { + "Author": `Juan del Peral`, + "About": `Piazzolla has a distinctive voice that conveys a personal style, especially in display sizes. It also has great performance and readability in small point sizes and long texts, both for screen and printing. +It's a versatile family providing users with plenty of features and moods. It spans a wide range of weights and an extensive character set for extended latin, polytonic greek and expert cyrillic. Piazzolla has more than 2300 characters and supports 210+ languages across all continents. It also supports advanced OpenType features such as small caps, dynamic ligatures and fractions, four set of figures, super and subscript characters, ordinals and language-specific variations for Catalan, Guaraní, Dutch, Turkish, Romanian, Serbian, Bulgarian, Bashkir, among others. See https://piazzolla.huertatipografica.com for more.`, + "Source": `https://github.com/huertatipografica/piazzolla`, + }, + }, +} + +// Templates. +// Optically correct scaling. +// Some people need larger body type. + + +func style(language, key, value string) (string, error) { + return "", nil +} + +func generate(mark, language string) (string, error) { + if Definitions[language] == nil { + return errors.New(language + " is a new language, define it") + } +} + +func Generate(language string, tag Tag) string { + switch t := Definitions[language][mark].(type) { + case string: + return t + case func(Tag): + t(tag) + } +} + +func Translate(document []any, language string, output io.Writer) { + for _, i := range document { + switch t := i.(type) { + case string: + output.Write(generate(language, *Tag{name: "Prefix"})) + output.Write(definitions[language]["Prefix"]) + output.Write(t) + output.Write(generate(language, *Tag{name: "Postfix"})) + case *parse.Tag: + fmt.Println(i.name) + } + } +} |