Initial support for ligation in Kitty (#1007)

This commit is contained in:
be5invis 2021-06-02 19:17:49 -07:00
parent f0402d2d40
commit 8a69ab9179
13 changed files with 220 additions and 42 deletions

View file

@ -108,6 +108,34 @@ const RequireCcmpDecompose = {
}
};
const Joining = {
get(glyph) {
if (glyph && glyph.related) return glyph.related.joining || 0;
else return 0;
},
set(glyph, cls) {
if (!glyph.related) glyph.related = {};
glyph.related.joining = cls;
},
amendOtName(baseName, cl) {
switch (cl) {
case Joining.Classes.Left:
return `${baseName}.join-l`;
case Joining.Classes.Right:
return `${baseName}.join-r`;
case Joining.Classes.Mid:
return `${baseName}.join-m`;
default:
return baseName;
}
},
Classes: {
Left: 1,
Right: 2,
Mid: 3
}
};
const CvTagCache = new Map();
function Cv(tag, rank) {
const key = tag + "#" + rank;
@ -363,6 +391,7 @@ exports.TieMark = TieMark;
exports.TieGlyph = TieGlyph;
exports.Radical = Radical;
exports.RequireCcmpDecompose = RequireCcmpDecompose;
exports.Joining = Joining;
exports.AnyDerivingCv = AnyDerivingCv;
exports.CcmpDecompose = CcmpDecompose;
exports.CvDecompose = CvDecompose;
@ -370,4 +399,4 @@ exports.createGrDisplaySheet = createGrDisplaySheet;
exports.DollarShrinkKernel = DollarShrinkKernel;
exports.DollarShorterBar = DollarShorterBar;
exports.MathSansSerif = MathSansSerif;
exports.SvInheritableRelations = [DollarShrinkKernel, DollarShorterBar];
exports.SvInheritableRelations = [DollarShrinkKernel, DollarShorterBar, Joining];