Skip to content

Commit

Permalink
Add localized forms for Polish and Romanian.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcwilliams403 committed Sep 1, 2024
1 parent bc2d279 commit 6e96da7
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 25 deletions.
1 change: 1 addition & 0 deletions changes/31.5.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Add Latin localization forms for Polish and Romanian.
2 changes: 1 addition & 1 deletion packages/font-glyphs/src/letter/cyrillic/de.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ glyph-block Letter-Cyrillic-De : begin
local sw : AdviceStroke 2.5 ((sr - sl + 2 * SB) / Width)
local shapeBot : de.desc - 0.5 * sw
local hook : Hook * (0 - shapeBot) / CAP
local ze : CyrZe 3 sb sw shapeBot sl sr 0.65 hook sw (0.5 * O) 0.5
local ze : CyrZe 3 sb sw shapeBot sl sr 0.65 hook sw (0.5 * O) (op -- 0.5)
return : union [ze.Shape] [ze.AutoEndSerifL]

create-glyph "cyrl/Dzze.\(suffix)" : glyph-proc
Expand Down
12 changes: 9 additions & 3 deletions packages/font-glyphs/src/letter/latin/c.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ glyph-block Letter-Latin-C : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Adjustment : ExtendAboveBaseAnchors ExtendBelowBaseAnchors LeaningAnchor
glyph-block-import Letter-Shared : CreateDependentComposite CreateTurnedLetter
glyph-block-import Letter-Shared : CreateAccentedComposition CreateDependentComposite CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : SerifFrame CurlyTail DToothlessRise
glyph-block-import Letter-Shared-Shapes : SerifedArcStart SerifedArcEnd
glyph-block-import Letter-Shared-Shapes : InwardSlabArcStart InwardSlabArcEnd
Expand Down Expand Up @@ -369,7 +369,7 @@ glyph-block Letter-Latin-C : begin
include [refer-glyph base] AS_BASE ALSO_METRICS
include : ExtendBelowBaseAnchors (-AccentHeight)

derive-composites 'cyrl/The.CHU' null 'cyrl/Es' 'cedillaExtShapeBelowOArc'
alias 'cyrl/The.CHU' null 'CCedilla'

derive-glyphs 'cyrl/the' 0x4AB "cyrl/es" : function [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
Expand All @@ -385,7 +385,13 @@ glyph-block Letter-Latin-C : begin
include [refer-glyph base] AS_BASE ALSO_METRICS
include : ExtendBelowBaseAnchors (-AccentHeight)

derive-composites 'cyrl/the.CHU' null 'cyrl/es' 'cedillaExtShapeBelowOArc'
alias 'cyrl/the.CHU' null 'cCedilla'

CreateAccentedComposition 'CAcute' 0x106 'C' 'acuteAbove'
CreateAccentedComposition 'cAcute' 0x107 'c' 'acuteAbove'

CreateAccentedComposition 'CAcute.PLK' null 'C' 'kreskaAbove'
CreateAccentedComposition 'cAcute.PLK' null 'c' 'kreskaAbove'

create-glyph 'mathbb/C' 0x2102 : glyph-proc
include : MarkSet.capital
Expand Down
4 changes: 4 additions & 0 deletions packages/font-glyphs/src/letter/latin/lower-n.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ glyph-block Letter-Latin-Lower-N : begin
glyph-block-import Common-Derivatives
glyph-block-import Mark-Shared-Metrics : markHalfStroke
glyph-block-import Mark-Adjustment : LeaningAnchor
glyph-block-import Letter-Shared : CreateAccentedComposition
glyph-block-import Letter-Shared-Shapes : CurlyTail nShoulder nShoulderKnots nShoulderMask
glyph-block-import Letter-Shared-Shapes : RightwardTailedBar DToothlessRise DMBlend MidHook
glyph-block-import Letter-Shared-Shapes : CyrDescender PalatalHook RetroflexHook EngHook
Expand Down Expand Up @@ -316,6 +317,9 @@ glyph-block Letter-Latin-Lower-N : begin
select-variant 'cyrl/yat.italic/base/corner' (shapeFrom -- 'cyrl/yat.italic/base')
select-variant 'cyrl/yat.italic/base/cursive' (shapeFrom -- 'cyrl/yat.italic/base')

CreateAccentedComposition 'nAcute' 0x144 'n' 'acuteAbove'
CreateAccentedComposition 'nAcute.PLK' null 'n' 'kreskaAbove'

do "n with Apostrophe"
derive-glyphs 'nApostrophe/comma' null 'commaAbove/asPunctuation' : function [src gr] : glyph-proc
include : with-transform [Translate (Width + SB - Middle) 0]
Expand Down
3 changes: 2 additions & 1 deletion packages/font-glyphs/src/letter/latin/lower-t.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ glyph-block Letter-Latin-Lower-T : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Adjustment : LeaningAnchor
glyph-block-import Letter-Shared : CreateCommaCaronComposition CreateTurnedLetter
glyph-block-import Letter-Shared : CreateAccentedComposition CreateCommaCaronComposition CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : CurlyTail FlatHookDepth ConnectedCedilla SerifedArcEnd
glyph-block-import Letter-Shared-Shapes : DiagTail DToothlessRise
glyph-block-import Letter-Shared-Shapes : TopHook PalatalHook
Expand Down Expand Up @@ -301,6 +301,7 @@ glyph-block Letter-Latin-Lower-T : begin
select-variant 't/phoneticRight'
CreateCommaCaronComposition 'tcaron' 0x165 't'
derive-glyphs 'tCedilla' 0x163 't' ConnectedCedilla
CreateAccentedComposition 'tComma' 0x21B 't' 'commaBelow'

select-variant "tHookTop" 0x1AD
select-variant 'tLTail' 0x1AB
Expand Down
6 changes: 6 additions & 0 deletions packages/font-glyphs/src/letter/latin/o.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ glyph-block Letter-Latin-O : begin
corner (SB - outStand) (yTurn - outStandY)
OShapeOutline.NoOvershoot XH 0 SB RightSB nothing nothing nothing

CreateAccentedComposition 'OAcute' 0xD3 'O' 'acuteAbove'
CreateAccentedComposition 'oAcute' 0xF3 'o' 'acuteAbove'

CreateAccentedComposition 'OAcute.PLK' null 'O' 'kreskaAbove'
CreateAccentedComposition 'oAcute.PLK' null 'o' 'kreskaAbove'

CreateAccentedComposition 'oDieresis' 0xF6 'o' 'dieresisAbove'

create-glyph 'numeroRightHalf' : glyph-proc
Expand Down
11 changes: 10 additions & 1 deletion packages/font-glyphs/src/letter/latin/s.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ glyph-module
glyph-block Letter-Latin-S : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Letter-Shared : CreateDependentComposite
glyph-block-import Letter-Shared : CreateAccentedComposition CreateDependentComposite
glyph-block-import Letter-Blackboard : BBS BBD
glyph-block-import Letter-Shared-Shapes : DToothlessRise FlatHookDepth
glyph-block-import Letter-Shared-Shapes : ArcStartSerifWidth ArcStartSerifDepth
Expand Down Expand Up @@ -406,9 +406,18 @@ glyph-block Letter-Latin-S : begin
flat RightSB Ascender [widths.rhs.heading sw Rightward]
curl (4 * Width) Ascender [widths.rhs.heading sw Rightward]

CreateAccentedComposition 'SAcute' 0x15A 'S' 'acuteAbove'
CreateAccentedComposition 'sAcute' 0x15B 's' 'acuteAbove'

CreateAccentedComposition 'SAcute.PLK' null 'S' 'kreskaAbove'
CreateAccentedComposition 'sAcute.PLK' null 's' 'kreskaAbove'

derive-composites 'SCedilla' 0x15E 'S' 'cedillaExtShapeBelowOArc'
derive-composites 'sCedilla' 0x15F 's' 'cedillaExtShapeBelowSOArc'

CreateAccentedComposition 'SComma' 0x218 'S' 'commaBelow'
CreateAccentedComposition 'sComma' 0x219 's' 'commaBelow'

create-glyph 'mathbb/S' 0x1D54A : glyph-proc
local df : include DfCapital
include : df.markSet.capital
Expand Down
4 changes: 4 additions & 0 deletions packages/font-glyphs/src/letter/latin/upper-n.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ glyph-block Letter-Latin-Upper-N : begin
glyph-block-import CommonShapes
glyph-block-import Common-Derivatives
glyph-block-import Mark-Shared-Metrics : markHalfStroke
glyph-block-import Letter-Shared : CreateAccentedComposition
glyph-block-import Letter-Shared-Shapes : CyrDescender SerifFrame PalatalHook EngHook CyrTailDescender

define BODY-SYMMETRIC 1
Expand Down Expand Up @@ -141,6 +142,9 @@ glyph-block Letter-Latin-Upper-N : begin

derive-composites 'NDescender' 0xA790 'N' [CyrDescender.rSideJut RightSB 0]

CreateAccentedComposition 'NAcute' 0x143 'N' 'acuteAbove'
CreateAccentedComposition 'NAcute.PLK' null 'N' 'kreskaAbove'

select-variant 'Eng' 0x14A (follow -- 'N')
select-variant 'smcpN' 0x274 (follow -- 'N')
select-variant 'NHookLeft' 0x19D (follow -- 'N')
Expand Down
5 changes: 4 additions & 1 deletion packages/font-glyphs/src/letter/latin/upper-t.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ glyph-block Letter-Latin-Upper-T : begin
glyph-block-import Mark-Adjustment : LeaningAnchor
glyph-block-import Letter-Blackboard : BBS BBD
glyph-block-import Letter-Latin-Lower-M
glyph-block-import Letter-Shared : CreateTurnedLetter
glyph-block-import Letter-Shared : CreateAccentedComposition CreateTurnedLetter
glyph-block-import Letter-Shared-Shapes : LetterBarOverlay UpwardHookShape
glyph-block-import Letter-Shared-Shapes : CyrDescender SerifFrame FlatHookDepth LeftHook RetroflexHook

Expand Down Expand Up @@ -192,6 +192,9 @@ glyph-block Letter-Latin-Upper-T : begin
select-variant 'cyrl/teTall.upright' (follow -- 'T')
select-variant 'cyrl/teTall.italic' (shapeFrom -- 'cyrl/teTall.upright') (follow -- 'T/rtailBase')

CreateAccentedComposition 'TCedilla' 0x0162 'T' 'cedillaBelow'
CreateAccentedComposition 'TComma' 0x021A 'T' 'commaBelow'

create-glyph 'mathbb/T' 0x1D54B : glyph-proc
local df : DivFrame 1
include : df.markSet.capital
Expand Down
40 changes: 25 additions & 15 deletions packages/font-glyphs/src/letter/latin/z.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,13 @@ glyph-block Letter-Latin-Z : begin
link-reduced-variant 'z/reduced' 'z'
select-variant 'z/rtailBase' (follow -- 'z')

select-variant 'ZHookBottom' 0x224 (follow -- 'ZDesc')
select-variant 'zHookBottom' 0x225 (follow -- 'zDesc')
select-variant 'ZSwash' 0x2C7F (follow -- 'ZDesc')
select-variant 'zSwash' 0x240 (follow -- 'zDesc')
select-variant 'zCurlyTail' 0x291 (follow -- 'zDesc')
select-variant 'cyrl/Zemlya' 0xA640 (follow -- 'ZDesc')
select-variant 'cyrl/zemlya' 0xA641 (follow -- 'zDesc')
select-variant 'ZHookBottom' 0x224 (follow -- 'ZDesc')
select-variant 'zHookBottom' 0x225 (follow -- 'zDesc')
select-variant 'ZSwash' 0x2C7F (follow -- 'ZDesc')
select-variant 'zSwash' 0x240 (follow -- 'zDesc')
select-variant 'zCurlyTail' 0x291 (follow -- 'zDesc')
select-variant 'cyrl/Zemlya' 0xA640 (follow -- 'ZDesc')
select-variant 'cyrl/zemlya' 0xA641 (follow -- 'zDesc')
select-variant 'cyrl/Zemlya/reduced' (follow -- 'ZDesc/reduced') (shapeFrom -- 'cyrl/Zemlya')
select-variant 'cyrl/zemlya/reduced' (follow -- 'zDesc/reduced') (shapeFrom -- 'cyrl/zemlya')

Expand All @@ -354,6 +354,24 @@ glyph-block Letter-Latin-Z : begin
alias 'grek/Zeta' 0x396 'Z/reduced'
alias-reduced-variant 'grek/Zeta/sansSerif' 'grek/Zeta' 'Z/reduced/sansSerif' MathSansSerif

CreateAccentedComposition 'ZAcute' 0x179 'Z' 'acuteAbove'
CreateAccentedComposition 'zAcute' 0x17A 'z' 'acuteAbove'
CreateAccentedComposition 'ZDot' 0x17B 'Z' 'dotAbove'
CreateAccentedComposition 'zDot' 0x17C 'z' 'dotAbove'
CreateAccentedComposition 'ZCaron' 0x17D 'Z' 'caronAbove' true
CreateAccentedComposition 'zCaron' 0x17E 'z' 'caronAbove' true

CreateAccentedComposition 'ZAcute.PLK' null 'Z' 'kreskaAbove'
CreateAccentedComposition 'zAcute.PLK' null 'z' 'kreskaAbove'
CreateAccentedComposition 'ZDot.PLK' null 'Z' 'kropkaAbove'
CreateAccentedComposition 'zDot.PLK' null 'z' 'kropkaAbove'

CreateAccentedComposition 'ZStroke' 0x1B5 'Z/reduced' 'barOver'
CreateAccentedComposition 'zStroke' 0x1B6 'z/reduced' 'barOver'

CreateAccentedComposition 'cyrl/Dzelo' 0xA642 'cyrl/Zemlya/reduced' 'barOver'
CreateAccentedComposition 'cyrl/dzelo' 0xA643 'cyrl/zemlya/reduced' 'barOver'

define [BBZShape top] : glyph-proc
include : HBar.t SB RightSB top BBS
include : HBar.b SB RightSB 0 BBS
Expand Down Expand Up @@ -381,11 +399,3 @@ glyph-block Letter-Latin-Z : begin

create-glyph 'mathbb/Z' 0x2124 : composite-proc [MarkSet.capital] [BBZShape CAP]
create-glyph 'mathbb/z' 0x1D56B : composite-proc [MarkSet.e] [BBZShape XH]


CreateAccentedComposition 'ZBar' 0x1B5 'Z/reduced' 'barOver'
CreateAccentedComposition 'zBar' 0x1B6 'z/reduced' 'barOver'
CreateAccentedComposition 'ZCaron' 0x17D 'Z' 'caronAbove' true
CreateAccentedComposition 'zCaron' 0x17E 'z' 'caronAbove' true
CreateAccentedComposition 'cyrl/ZemlyaBar' 0xA642 'cyrl/Zemlya/reduced' 'barOver'
CreateAccentedComposition 'cyrl/zemlyaBar' 0xA643 'cyrl/zemlya/reduced' 'barOver'
6 changes: 6 additions & 0 deletions packages/font-glyphs/src/marks/above.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ glyph-block Mark-Above : begin
select-variant 'elipsisAbove' 0x20DB (follow -- 'diacriticDot')
select-variant 'fourDotsAbove' 0x20DC (follow -- 'diacriticDot')
select-variant 'tittleAbove' (shapeFrom -- "dotAbove") (follow -- 'tittle')
select-variant 'kropkaAbove' (shapeFrom -- "dotAbove") (follow -- 'tittle')

glyph-block-export RingDims RingShape
define [RingDims _radiusOut] : begin
Expand Down Expand Up @@ -1244,6 +1245,11 @@ glyph-block Mark-Above : begin
flat (markMiddle + d + wide) aboveMarkTop [heading Downward]
curl (markMiddle + d - wide) aboveMarkBot [widths.heading fine fine Downward]

create-glyph 'kreskaAbove' : glyph-proc
set-width 0
include : refer-glyph 'tonosAbove'
include : StdAnchors.narrow

# Scaled-down glyphs for Vietnamese's secondary mark
define [VNSecondaryMark s kx ky d] : glyph-proc
include : ScaleAround markMiddle aboveMarkMid s s
Expand Down
33 changes: 33 additions & 0 deletions packages/font-otl/src/gsub-locl.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export : define [buildLOCL gsub para glyphStore] : begin
define cyrlBGR : gsub.copyLanguage 'cyrl_BGR ' 'cyrl_DFLT'
define cyrlBSH : gsub.copyLanguage 'cyrl_BSH ' 'cyrl_DFLT'
define cyrlCHU : gsub.copyLanguage 'cyrl_CHU ' 'cyrl_DFLT'
define latnPLK : gsub.copyLanguage 'latn_PLK ' 'latn_DFLT'
define latnROM : gsub.copyLanguage 'latn_ROM ' 'latn_DFLT'
define latnMOL : gsub.copyLanguage 'latn_MOL ' 'latn_DFLT'
define latnTRK : gsub.copyLanguage 'latn_TRK ' 'latn_DFLT'
define latnAZE : gsub.copyLanguage 'latn_AZE ' 'latn_DFLT'
define latnGAG : gsub.copyLanguage 'latn_GAG ' 'latn_DFLT'
Expand Down Expand Up @@ -47,6 +50,36 @@ export : define [buildLOCL gsub para glyphStore] : begin
define loclCHU : cyrlCHU.addFeature : gsub.createFeature 'locl'
loclCHU.addLookup : createGsubLookupFromGr gsub glyphStore LocalizedForm.CHU

# PLK
define loclPLK : latnPLK.addFeature : gsub.createFeature 'locl'
loclPLK.addLookup : gsub.createLookup
.type 'gsub_single'
.substitutions : object
'CAcute' : glyphStore.ensureExists 'CAcute.PLK'
'cAcute' : glyphStore.ensureExists 'cAcute.PLK'
'NAcute' : glyphStore.ensureExists 'NAcute.PLK'
'nAcute' : glyphStore.ensureExists 'nAcute.PLK'
'OAcute' : glyphStore.ensureExists 'OAcute.PLK'
'oAcute' : glyphStore.ensureExists 'oAcute.PLK'
'SAcute' : glyphStore.ensureExists 'SAcute.PLK'
'sAcute' : glyphStore.ensureExists 'sAcute.PLK'
'ZAcute' : glyphStore.ensureExists 'ZAcute.PLK'
'zAcute' : glyphStore.ensureExists 'zAcute.PLK'
'ZDot' : glyphStore.ensureExists 'ZDot.PLK'
'zDot' : glyphStore.ensureExists 'zDot.PLK'

# ROM
define loclROM : gsub.createFeature 'locl'
latnROM.addFeature loclROM
latnMOL.addFeature loclROM
loclROM.addLookup : gsub.createLookup
.type 'gsub_single'
.substitutions : object
'SCedilla' : glyphStore.ensureExists 'SComma'
'sCedilla' : glyphStore.ensureExists 'sComma'
'TCedilla' : glyphStore.ensureExists 'TComma'
'tCedilla' : glyphStore.ensureExists 'tComma'

# TRK
define loclTRK : gsub.createFeature 'locl'
latnTRK.addFeature loclTRK
Expand Down
2 changes: 1 addition & 1 deletion params/variants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7661,7 +7661,7 @@ selectorAffix."cyrl/yae/left" = "bottomRightSerifed"
[prime.tittle]
sampler = "ij "
hotChars = "ij"
samplerExplain = "Dots in letters “i” and “j” in particular (not including dots in other letters, even if they are similar)"
samplerExplain = "Dots in letters “i” and “j” in particular"
tagKind = "dot"

[prime.tittle.variants.round]
Expand Down
4 changes: 2 additions & 2 deletions tools/generate-samples/src/templates/languages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ const languages = [
{ lang: 'Macedonian', sample: 'Ѕидарски пејзаж: шугав билмез со чудење џвака ќофте и кељ на туѓ цех.', localeId :'mk' },
{ lang: 'Maltese', sample: 'Kien liebes gozz ħwejjeġ u ċraret vera qodma u m’għażluhx fil-pront.' },
{ lang: 'Norwegian', sample: 'Jeg begynte å fortære en sandwich mens jeg kjørte taxi på vei til quiz.' },
{ lang: 'Polish', sample: 'Pchnąć w tę łódź jeża lub ośm skrzyń fig.' },
{ lang: 'Polish', sample: 'Pchnąć w tę łódź jeża lub ośm skrzyń fig.', localeId: 'pl' },
{ lang: 'Portuguese', sample: 'Luís argüia à Júlia que «brações, fé, chá, óxido, pôr, zângão» eram palavras do português.' },
{ lang: 'Romanian', sample: 'Înjurând pițigăiat, zoofobul comandă vexat whisky și tequila.' },
{ lang: 'Romanian', sample: 'Înjurând pițigăiat, zoofobul comandă vexat whisky și tequila.', localeId :'ro' },
{ lang: 'Russian', sample: 'Широкая электрификация южных губерний даст мощный толчок подъёму сельского хозяйства.' },
{ lang: 'Serbian', sample: 'Ајшо, лепото и чежњо, за љубав срца мога дођи у Хаџиће на кафу.', localeId: 'sr' },
{ lang: 'Slovak', sample: 'Kŕdeľ šťastných ďatľov učí pri ústí Váhu mĺkveho koňa obhrýzať kôru a žrať čerstvé mäso.' },
Expand Down

0 comments on commit 6e96da7

Please sign in to comment.