Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ccmp substitutions for DZ/Dz/dz with combining caron, for DŽ/Dž/dž. #2558

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions packages/font-glyphs/src/auto-build/composite.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$$include '../meta/macros.ptl'

import [mix linreg clamp fallback] from "@iosevka/util"
import [getGrMesh AnyCvOrCherryPicking CvDecompose Joining hashCv IsCompositeOrLigature NLDAcuteVariant] from "@iosevka/glyph/relation"
import [getGrMesh AnyCvOrCherryPicking CvDecompose Joining hashCv IsCompositeOrLigature NLDAcuteVariant HBSCaronVariant] from "@iosevka/glyph/relation"
import [hashGeometry] from "@iosevka/geometry"
import [Transform] from "@iosevka/geometry/transform"
extern Map
Expand Down Expand Up @@ -836,7 +836,7 @@ glyph-block AutoBuild-Enclosure : begin
list 0x2789 {'one/sansSerif.lnum' 'zero.lnum'} WideWidth1
list 0x1F16D {'C' 'C'} WideWidth2
list 0x1F12D {'C' 'D'} WideWidth1
list 0x1F12E {'W' 'z'} WideWidth1
list 0x1F12E {'W' 'smcpZ'} WideWidth1
foreach [j : range 10 till 20] : compositions.push : list (0x2460 + j - 1) [digitGlyphNames j] WideWidth1
foreach [j : range 21 till 35] : compositions.push : list (0x3251 + j - 21) [digitGlyphNames j] WideWidth1
foreach [j : range 36 till 50] : compositions.push : list (0x32B1 + j - 36) [digitGlyphNames j] WideWidth1
Expand Down Expand Up @@ -1445,7 +1445,7 @@ glyph-block Autobuild-Ligatures : begin
list 0xEF11 { 'IAcute' 'JAcute' }
list 0xEF12 { 'iAcute' 'jAcute' }

# Link Gr for acuted variants
# Link Gr for acute variants
NLDAcuteVariant.set [glyphStore.queryByUnicodeEnsured 0x132] [glyphStore.queryNameByUnicodeEnsured 0xEF11]
NLDAcuteVariant.set [glyphStore.queryByUnicodeEnsured 0x133] [glyphStore.queryNameByUnicodeEnsured 0xEF12]

Expand All @@ -1471,6 +1471,11 @@ glyph-block Autobuild-Ligatures : begin
list 0x2116 { 'N' 'numeroRightHalf' }
list 0x1F190 { 'D' 'J' } WideWidth1

# Link Gr for caron variants
HBSCaronVariant.set [glyphStore.queryByUnicodeEnsured 0x1F1] [glyphStore.queryNameByUnicodeEnsured 0x1C4]
HBSCaronVariant.set [glyphStore.queryByUnicodeEnsured 0x1F2] [glyphStore.queryNameByUnicodeEnsured 0x1C5]
HBSCaronVariant.set [glyphStore.queryByUnicodeEnsured 0x1F3] [glyphStore.queryNameByUnicodeEnsured 0x1C6]

createLigatures 'romanNumerals1' 1 1 1 1 0 : list
list 0x2160 { 'I' }
list 0x2164 { 'V' }
Expand Down
2 changes: 1 addition & 1 deletion packages/font-glyphs/src/auto-build/recursive-build.ptl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ glyph-block Recursive-Build : begin

define [MiniatureParaT] : with-params [pp crowd scale [sbscale (Width / UPM)] [mono false] [mono2 false] [forceUpright false]] : begin
local forkedPara : Object.assign {.} pp
forkedPara.stroke = [AdviceStroke crowd : Math.pow [clamp 0 1 (HalfUPM / Width)] 0.5] / scale
forkedPara.stroke = [AdviceStroke crowd : Math.sqrt : clamp 0 1 (HalfUPM / Width)] / scale
forkedPara.dotSize = pp.dotSize * forkedPara.stroke / pp.stroke
forkedPara.periodSize = pp.periodSize * forkedPara.stroke / pp.stroke
forkedPara.sb = SB * sbscale
Expand Down
13 changes: 12 additions & 1 deletion packages/font-otl/src/gsub-ccmp.ptl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$$include './meta/macros.ptl'

import [UkMapToLookup UkLigatureToLookup] from "./table-util.mjs"
import [Dotless TieMark TieGlyph OgonekTrY IsSuperscript IsSubscript LeaningMark LeaningMarkSpacer NLDAcuteVariant] from "@iosevka/glyph/relation"
import [Dotless TieMark TieGlyph OgonekTrY IsSuperscript IsSubscript LeaningMark LeaningMarkSpacer NLDAcuteVariant HBSCaronVariant] from "@iosevka/glyph/relation"
import as UnicodeKnowledge from "@iosevka/font-glyphs/unicode-knowledge"

extern Map
Expand Down Expand Up @@ -132,6 +132,17 @@ export : define [buildCCMP gsub glyphStore markGlyphs] : begin
.type 'gsub_ligature'
.substitutions substitutions

Ccmp-Group "DZ-Caron composites" : begin
local substitutions {}
foreach { gn g } [glyphStore.namedEntries] : begin
local hbsVariant : HBSCaronVariant.get g
if hbsVariant : substitutions.push
object [from : list gn 'caronAbove'] [to hbsVariant]

export-lookup : gsub.createLookup : object
.type 'gsub_ligature'
.substitutions substitutions

Ccmp-Group "Leaning Mark Trasnform" : begin
define LeaningAnchorMap : list
list 'above' 'leaningAbove'
Expand Down
1 change: 1 addition & 0 deletions packages/glyph/src/relation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const TieMark = LinkedGlyphProp("TieMark");
export const LeaningMark = LinkedGlyphProp("LeaningMark");
export const LeaningMarkSpacer = LinkedGlyphProp("LeaningMarkSpacer");
export const NLDAcuteVariant = LinkedGlyphProp("NLDAcuteVariant");
export const HBSCaronVariant = LinkedGlyphProp("HBSCaronVariant");

export const LocalizedForm = {
SRB: {
Expand Down
Loading