Skip to content

Commit

Permalink
Add localized forms for Bashkir and Chuvash. (#2485)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcwilliams403 authored Aug 30, 2024
1 parent 5f20ec7 commit 0219a50
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 7 deletions.
1 change: 1 addition & 0 deletions changes/31.4.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
- KAYAH LI SIGN CWI (`U+A92E`).
- ZERO WIDTH NON-BREAKING SPACE (`U+FEFF`).
* Add APL form (`APLF`) for `U+25E0` and `U+25E1`, for UIUA.
* Add Cyrillic localization forms for Bashkir and Chuvash.
16 changes: 16 additions & 0 deletions packages/font-glyphs/src/letter/cyrillic/orthography.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,19 @@ glyph-block Letter-Cyrillic-Orthography : begin
link-gr LocalizedForm.BGR 'cyrl/tse' 'cyrl/tse.BGR'
link-gr LocalizedForm.BGR 'cyrl/yer' 'cyrl/yer.BGR'
link-gr LocalizedForm.BGR 'cyrl/yeri' 'cyrl/yeri.BGR'

link-gr LocalizedForm.BSH.Upright 'cyrl/Ghayn' 'cyrl/Ghayn.BSH'
link-gr LocalizedForm.BSH.Upright 'cyrl/ghayn' 'cyrl/ghayn.BSH'
link-gr LocalizedForm.BSH.Upright 'cyrl/Dhe' 'cyrl/Dhe.BSH'
link-gr LocalizedForm.BSH.Upright 'cyrl/dhe' 'cyrl/dhe.BSH'
link-gr LocalizedForm.BSH.Upright 'cyrl/The' 'cyrl/The.BSH'
link-gr LocalizedForm.BSH.Upright 'cyrl/the' 'cyrl/the.BSH'

link-gr LocalizedForm.BSH.Italic 'cyrl/Ghayn' 'cyrl/Ghayn.BSH'
link-gr LocalizedForm.BSH.Italic 'cyrl/Dhe' 'cyrl/Dhe.BSH'
link-gr LocalizedForm.BSH.Italic 'cyrl/dhe' 'cyrl/dhe.BSH'
link-gr LocalizedForm.BSH.Italic 'cyrl/The' 'cyrl/The.BSH'
link-gr LocalizedForm.BSH.Italic 'cyrl/the' 'cyrl/the.BSH'

link-gr LocalizedForm.CHU 'cyrl/The' 'cyrl/The.CHU'
link-gr LocalizedForm.CHU 'cyrl/the' 'cyrl/the.CHU'
40 changes: 35 additions & 5 deletions packages/font-glyphs/src/letter/greek/lower-epsilon.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ glyph-block Letter-Greek-Lower-Epsilon : begin
glyph-block-export CyrZe
define [CyrZe] : with-params [
slabTop slabBot top bot left right blend hook _stroke
[xo OX] [op OverlayPos] [ada2 SmallArchDepthA] [adb2 SmallArchDepthB]
[xo OX] [yo O] [op OverlayPos] [ada2 SmallArchDepthA] [adb2 SmallArchDepthB]
] : namespace
export : define [Dim] : begin
local stroke : fallback _stroke : AdviceStroke2 2 3 (top - bot)
local midx : mix right left blend
local midy : mix bot top op
local topHeight : top - bot
local midyHeight : midy - bot
local adb : topHeight - [mix (midyHeight + stroke / 2) (topHeight - O - stroke) (ArchDepthA / (ArchDepthA + ArchDepthB))] + [HSwToV TanSlope] * stroke
local ada : [mix (stroke + O) (midyHeight - stroke / 2) (ArchDepthA / (ArchDepthA + ArchDepthB))] - [HSwToV TanSlope] * stroke
local adb : topHeight - [mix (midyHeight + stroke / 2) (topHeight - yo - stroke) (ArchDepthA / (ArchDepthA + ArchDepthB))] + [HSwToV TanSlope] * stroke
local ada : [mix (stroke + yo) (midyHeight - stroke / 2) (ArchDepthA / (ArchDepthA + ArchDepthB))] - [HSwToV TanSlope] * stroke
local fine : stroke * CThin
local stemFine : stroke * (ShoulderFine / Stroke)
return : object stroke midx midy ada adb fine stemFine
Expand Down Expand Up @@ -242,6 +242,22 @@ glyph-block Letter-Greek-Lower-Epsilon : begin
include : let [ze : CyrZe slabTop slabBot XH Descender SB RightSB StdBlend SHook]
union [ze.Shape] [ze.AutoStartSerifL] [ze.AutoEndSerifL]

create-glyph "cyrl/Dhe.\(suffix)" : glyph-proc
include [refer-glyph "cyrl/Ze.\(suffix)"] AS_BASE ALSO_METRICS
include : ExtendBelowBaseAnchors (-LongJut + 0.5 * Stroke)
include : let [zeNoO : CyrZe slabTop slabBot CAP 0 SB RightSB StdBlend Hook (xo -- 0) (yo -- 0)]
difference
VBar.m Middle (-LongJut + 0.5 * Stroke) (Stroke + O) [AdviceStroke 3.5]
zeNoO.ShapeMask

create-glyph "cyrl/dhe.\(suffix)" : glyph-proc
include [refer-glyph "cyrl/ze.\(suffix)"] AS_BASE ALSO_METRICS
include : ExtendBelowBaseAnchors (-LongJut + 0.5 * Stroke)
include : let [zeNoO : CyrZe slabTop slabBot XH 0 SB RightSB StdBlend SHook (xo -- 0) (yo -- 0)]
difference
VBar.m Middle (-LongJut + 0.5 * Stroke) (Stroke + O) [AdviceStroke 3.5]
zeNoO.ShapeMask

create-glyph "cyrl/DzjeKomi.\(suffix)" : glyph-proc
include : MarkSet.capital
local ze : CyrZe slabTop OPEN-VERTICAL CAP 0 SB RightSB StdBlend Hook
Expand Down Expand Up @@ -482,8 +498,22 @@ glyph-block Letter-Greek-Lower-Epsilon : begin
select-variant 'cyrl/DzjeKomi' 0x506 (follow -- 'cyrl/ZeTopSerifOnly')
select-variant 'cyrl/dzjeKomi' 0x507 (follow -- 'cyrl/zeTopSerifOnly')

derive-composites 'cyrl/Dhe' 0x498 'cyrl/Ze' 'cedillaExtShapeBelowOArc'
derive-composites 'cyrl/dhe' 0x499 'cyrl/ze' 'cedillaExtShapeBelowSOArc'
select-variant 'cyrl/Dhe' 0x498 (follow -- 'cyrl/Ze')
select-variant 'cyrl/dhe' 0x499 (follow -- 'cyrl/ze')

derive-multi-part-glyphs 'cyrl/Dhe.BSH' null { 'cyrl/Ze' 'invCommaBelow' } : lambda [srcs gr] : glyph-proc
local { base mark } srcs
include : refer-glyph mark
include : Translate Width AccentClearance
include [refer-glyph base] AS_BASE ALSO_METRICS
include : ExtendBelowBaseAnchors (-AccentHeight)

derive-multi-part-glyphs 'cyrl/dhe.BSH' null { 'cyrl/ze' 'invCommaBelow' } : lambda [srcs gr] : glyph-proc
local { base mark } srcs
include : refer-glyph mark
include : Translate Width AccentClearance
include [refer-glyph base] AS_BASE ALSO_METRICS
include : ExtendBelowBaseAnchors (-AccentHeight)

select-variant 'latn/epsilon/descBase' (shapeFrom -- 'latn/epsilon')
select-variant 'latn/epsilonRev/descBase' (shapeFrom -- 'cyrl/ze') (follow -- 'cyrl/ze/descBase')
Expand Down
34 changes: 32 additions & 2 deletions packages/font-glyphs/src/letter/latin/c.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,38 @@ glyph-block Letter-Latin-C : begin

derive-composites 'CCedilla' 0xC7 'C' 'cedillaExtShapeBelowOArc'
derive-composites 'cCedilla' 0xE7 'c' 'cedillaExtShapeBelowOArc'
derive-composites 'cyrl/The' 0x4AA 'cyrl/Es' 'cedillaExtShapeBelowOArc'
derive-composites 'cyrl/the' 0x4AB 'cyrl/es' 'cedillaExtShapeBelowOArc'

derive-glyphs 'cyrl/The' 0x4AA "cyrl/Es" : function [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
include : ExtendBelowBaseAnchors (-LongJut + 0.5 * Stroke)
include : difference
VBar.m Middle (-LongJut + 0.5 * Stroke) (Stroke + O) [AdviceStroke 3.5]
OShapeOutline.NoOvershoot CAP 0 SB RightSB Stroke ArchDepthA ArchDepthB

derive-multi-part-glyphs 'cyrl/The.BSH' null { 'cyrl/Es' 'invCommaBelow' } : lambda [srcs gr] : glyph-proc
local { base mark } srcs
include : refer-glyph mark
include : Translate Width AccentClearance
include [refer-glyph base] AS_BASE ALSO_METRICS
include : ExtendBelowBaseAnchors (-AccentHeight)

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

derive-glyphs 'cyrl/the' 0x4AB "cyrl/es" : function [src gr] : glyph-proc
include [refer-glyph src] AS_BASE ALSO_METRICS
include : ExtendBelowBaseAnchors (-LongJut + 0.5 * Stroke)
include : difference
VBar.m Middle (-LongJut + 0.5 * Stroke) (Stroke + O) [AdviceStroke 3.5]
OShapeOutline.NoOvershoot XH 0 SB RightSB Stroke SmallArchDepthA SmallArchDepthB

derive-multi-part-glyphs 'cyrl/the.BSH' null { 'cyrl/es' 'invCommaBelow' } : lambda [srcs gr] : glyph-proc
local { base mark } srcs
include : refer-glyph mark
include : Translate Width AccentClearance
include [refer-glyph base] AS_BASE ALSO_METRICS
include : ExtendBelowBaseAnchors (-AccentHeight)

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

create-glyph 'mathbb/C' 0x2102 : glyph-proc
include : MarkSet.capital
Expand Down
3 changes: 3 additions & 0 deletions packages/font-glyphs/src/letter/latin/upper-f.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ glyph-block Letter-Latin-Upper-F : begin
select-variant 'FBar' 0xA798 (follow -- 'F')
select-variant 'currency/frenchFrancSign' 0x20A3

alias 'cyrl/Ghayn.BSH' null 'F'
alias 'cyrl/ghayn.BSH' null 'smcpF'

glyph-block-import Letter-Blackboard : BBS BBD
create-glyph 'mathbb/F' 0x1D53D : glyph-proc
include : MarkSet.capital
Expand Down
1 change: 1 addition & 0 deletions packages/font-glyphs/src/marks/below.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ glyph-block Mark-Below : begin
TurnAboveMarkToBelow 'elipsisBelow' 0x20E8 'elipsisAbove'
TurnAboveMarkToBelow 'leftArrowBelow' 0x20EE 'rightArrowAbove'
TurnAboveMarkToBelow 'rightArrowBelow' 0x20EF 'leftArrowAbove'
TurnAboveMarkToBelow 'invCommaBelow' null 'revCommaAbove'
TurnAboveMarkToBelow 'upArrowHeadBelow' null 'downArrowHeadAbove'
TurnAboveMarkToBelow 'downArrowHeadBelow' null 'upArrowHeadAbove'
TurnAboveMarkToBelow 'descenderBarBelow' null 'ascenderBarAbove'
Expand Down
11 changes: 11 additions & 0 deletions packages/font-otl/src/gsub-locl.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export : define [buildLOCL gsub para glyphStore] : begin
define cyrlMKD : gsub.copyLanguage 'cyrl_MKD ' 'cyrl_DFLT'
define cyrlBOS : gsub.copyLanguage 'cyrl_BOS ' 'cyrl_DFLT'
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 latnTRK : gsub.copyLanguage 'latn_TRK ' 'latn_DFLT'
define latnAZE : gsub.copyLanguage 'latn_AZE ' 'latn_DFLT'
define latnGAG : gsub.copyLanguage 'latn_GAG ' 'latn_DFLT'
Expand All @@ -36,6 +38,15 @@ export : define [buildLOCL gsub para glyphStore] : begin
define loclBGR : cyrlBGR.addFeature : gsub.createFeature 'locl'
loclBGR.addLookup : createGsubLookupFromGr gsub glyphStore LocalizedForm.BGR

# BSH
define loclBSH : cyrlBSH.addFeature : gsub.createFeature 'locl'
loclBSH.addLookup : createGsubLookupFromGr gsub glyphStore
if [not para.isItalic] LocalizedForm.BSH.Upright LocalizedForm.BSH.Italic

# CHU
define loclCHU : cyrlCHU.addFeature : gsub.createFeature 'locl'
loclCHU.addLookup : createGsubLookupFromGr gsub glyphStore LocalizedForm.CHU

# TRK
define loclTRK : gsub.createFeature 'locl'
latnTRK.addFeature loclTRK
Expand Down
8 changes: 8 additions & 0 deletions packages/glyph/src/relation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export const LocalizedForm = {
Italic: LinkedGlyphProp("SerbianLocItalic"),
},
BGR: LinkedGlyphProp("BulgarianLoc"),
BSH: {
Upright: LinkedGlyphProp("BashkirLocUpright"),
Italic: LinkedGlyphProp("BashkirLocItalic"),
},
CHU: LinkedGlyphProp("ChuvashLoc"),
IPPH: LinkedGlyphProp("IPALoc"),
};

Expand Down Expand Up @@ -184,6 +189,9 @@ export const AnyLocalizedForm = {
if (LocalizedForm.SRB.Upright.get(glyph)) grs.push(LocalizedForm.SRB.Upright);
if (LocalizedForm.SRB.Italic.get(glyph)) grs.push(LocalizedForm.SRB.Italic);
if (LocalizedForm.BGR.get(glyph)) grs.push(LocalizedForm.BGR);
if (LocalizedForm.BSH.Upright.get(glyph)) grs.push(LocalizedForm.BSH.Upright);
if (LocalizedForm.BSH.Italic.get(glyph)) grs.push(LocalizedForm.BSH.Italic);
if (LocalizedForm.CHU.get(glyph)) grs.push(LocalizedForm.CHU);
if (LocalizedForm.IPPH.get(glyph)) grs.push(LocalizedForm.IPPH);
if (grs.length) return grs;
return null;
Expand Down

0 comments on commit 0219a50

Please sign in to comment.