|
| 1 | +# Flagada |
| 2 | + |
| 3 | +A typst package to display **country flags** in your Typst documents. This first version is extremely simple, as the only two arguments is the country and the height of the flag to display in the document. |
| 4 | + |
| 5 | +## Loading the package |
| 6 | + |
| 7 | +```typst |
| 8 | +#import "@preview/flagada:0.1.0" : * |
| 9 | +``` |
| 10 | + |
| 11 | +## Calling a flag |
| 12 | + |
| 13 | +You need to know the ISO 3166-1 code of the country (string of 2 characters) to display. |
| 14 | + |
| 15 | +Either call the flag as with the long call version `flag-zz()` or short call `flag("ZZ")`, `zz` or `"ZZ"` being the ISO 3166-1 code. |
| 16 | + |
| 17 | +Please note that long call version, like `flag-zz()`, must use _lowercase_ of the ISO 3166-1 code. Short version can use both _lowercase_ or _uppercase_ of the ISO 3166-1 |
| 18 | + |
| 19 | +### Example |
| 20 | + |
| 21 | +```typst |
| 22 | +Hello people coming from #flag-fr(), #flag-eu(), #flag("DE") and more |
| 23 | +``` |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +## Modifying the height |
| 28 | + |
| 29 | +By default the flag height is `0.65em`, which is usually the default text size. |
| 30 | + |
| 31 | +To modify the height, include the `height` parameter in your call. |
| 32 | + |
| 33 | +Either call the flag as `flag-zz(height:6em)` or `flag("ZZ",height:6em)`, `zz` or `"ZZ"` being the ISO 3166-1 code. |
| 34 | + |
| 35 | +### Example for height |
| 36 | + |
| 37 | +```typst |
| 38 | +Hello people coming from #flag-be(height: 1em), #flag-fr(height: 2em), #flag-eu(height:3em), #flag("DE",height: 2em), #flag("LU",height: 1em) and more |
| 39 | +``` |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +## Comments |
| 44 | + |
| 45 | +### Coat of arms |
| 46 | + |
| 47 | +Some flags include coat of arms or other specific components. As ususally these components are hard to build in Typst, a SVG version from wikimedia is used. The coat of arms for countries are in directory `coat of arms/` |
| 48 | + |
| 49 | +#### Example of coat of arms |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | +In this example, coats of arms are used for Spanish and Portuguese flags (but not for European flag as stars can be constructed or displayed from an unicode like `U+2605`) |
| 54 | + |
| 55 | +### Width not updatable |
| 56 | + |
| 57 | +For the moment, the official format defined by each country has been used to build their flag (e.g. 1:2 fro GB, 2:3 for FR, 10:19 for US ...). No possibility to modify the width has been considered. As a consequence, when you display two or more flags close to each other at the same height, their width might not be equal for each flag. |
| 58 | + |
| 59 | +### Flags covered so far |
| 60 | + |
| 61 | +Flags for the following ISO 3166-1 codes are available in the initial version (0.1.0): |
| 62 | + |
| 63 | +AD AE AG AL AM AO AR AT AU AZ BA BB BD BE BF BG BH BI BJ BN BO BR BS BT BW BY BZ |
| 64 | +CA CD CF CG CH CI CL CM CN CO CR CU CV CY CZ DE DJ DK DO DZ EC EE EG ER ES ET EU FI |
| 65 | +FR GA GB GE GH GM GN GQ GR GT GW GY HN HR HT HU ID IE IL IN IQ IR IS IT JM JO JP KE |
| 66 | +KH KM KP KR KW LA LB LI LK LR LS LT LU LV LY MA MC MD ME MG MK ML MM MN MR MT |
| 67 | +MU MV MW MX MY MZ NA NE NG NI NL NO NP NZ OM PA PE PH PK PL PS PT PY QA RO RS RU |
| 68 | +SA SC SD SE SG SI SK SL SM SN SO SR SS ST SY SZ TG TL TN TR TW TZ UA UG US UY VA VE VN YE ZA ZM ZW |
| 69 | + |
| 70 | +For these flags, comments are welcome |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | +### Flags not yet covered so far |
| 75 | + |
| 76 | +The flags for remaining ISO 3166-1 codes have not been developped and might be developped for the next version |
| 77 | + |
| 78 | +AF AI AQ AS AW AX BL BM BQ BV CC CK CW CX DM EH FJ FK FM FO GD GF GG GI GL GP GS |
| 79 | +GU HK HM IM IO JE KG KI KN KY KZ LC MF MH MO MP MQ MS NC NF NR NU PF PG PM PN |
| 80 | +PR PW RE RW SB SH SJ SV SX TC TD TF TH TJ TK TM TO TT TV UM UZ VC VG VI VU WF WS |
| 81 | +YT |
0 commit comments