Fix build break

This commit is contained in:
be5invis 2024-02-03 17:32:42 -08:00
parent 63bbdd6215
commit 610806fd7c
5 changed files with 57 additions and 30 deletions

View file

@ -76,7 +76,6 @@ glyph-block Autobuild-Enclosure-Shared : begin
local jobsOrig : if demandDecomposable decomposableJobs nonDecomposable
jobsOrig.push { origJobGlyphGn unicode parts :: restInfo }
if para.enableCvSs : begin
if demandDecomposable
: then : foreach part [items-of parts] : begin
local mesh : getGrMesh { part } AnyCvOrCherryPicking query-glyph

View file

@ -58,8 +58,9 @@ class CvLookupManager
return lookup
public [linkDeps] : begin
if this.decompositionLookup : begin
if (this.decompositionLookup && this.altrenatesLookup) : begin
this.table.setDependency this.decompositionLookup this.altrenatesLookup
if this.altrenatesLookup : begin
foreach lookupSS [items-of this.singleSubstLookups] : if lookupSS : begin
this.table.setDependency this.altrenatesLookup lookupSS
foreach lookupCP [items-of this.cherryPickingLookups] : if lookupCP : begin
@ -68,7 +69,10 @@ class CvLookupManager
this.table.setDependency lookupCP lookupSS
public [linkCrossDeps other] : begin
if (this.altrenatesLookup && other.altrenatesLookup) : begin
this.table.setDependency this.altrenatesLookup other.altrenatesLookup
if other.altrenatesLookup : begin
foreach lookupSS [items-of this.singleSubstLookups] : if lookupSS : begin
this.table.setDependency lookupSS other.altrenatesLookup
@ -154,6 +158,7 @@ export : define [buildCVSS gsub para glyphStore] : begin
sortedCvs.sort CvLookupManager.compare
foreach cv [items-of sortedCvs] : begin
if cv.altrenatesLookup : begin
local st cv.altrenatesLookup.substitutions
foreach { k v } [pairs-of st] : foreach idx [range 0 v.length] : if [not v.(idx)]
set v.(idx) k

View file

@ -36,7 +36,6 @@ define [buildGSUB para glyphStore markGlyphs] : begin
# As it is a cv/ss "cherry picking".
# APLF
if para.enableCvSs : begin
buildGrFeature gsub glyphStore Gr.AplForm
# numr / dnom
@ -61,7 +60,6 @@ define [buildGSUB para glyphStore markGlyphs] : begin
# cv##, ss##
local cvs nothing
if para.enableCvSs : begin
set cvs : buildCVSS gsub para glyphStore
# ccmp post cv/ss (for Ogonek shape transform)

View file

@ -61,6 +61,26 @@ export class DependencyManager {
}
s.add(dependency);
}
hasGlyphToGlyphDependency(dependent, dependency) {
return this.hasGlyphToGlyphDependencyImpl(new Set(), dependent, dependency);
}
hasGlyphToGlyphDependencyImpl(alreadyScanned, dependent, dependency) {
// Prevent infinite recursion
if (alreadyScanned.has(dependent)) return true;
alreadyScanned.add(dependent);
// Check for direct dependency
if (!this.glyphToGlyph.has(dependent)) return false;
const ds = this.glyphToGlyph.get(dependent);
if (ds.has(dependency)) return true;
// Check for indirect dependency
for (const d of ds) {
if (this.hasGlyphToGlyphDependencyImpl(alreadyScanned, d, dependency)) return true;
}
return false;
}
traverseGlyphDependenciesImpl(glyphs, fBlockwiseExpand) {
let state = new Map();

View file

@ -2,7 +2,7 @@ import * as util from "util";
import * as Geom from "@iosevka/geometry";
import { Anchor } from "@iosevka/geometry/anchor";
import { Point, Vec2 } from "@iosevka/geometry/point";
import { Vec2 } from "@iosevka/geometry/point";
import { Transform } from "@iosevka/geometry/transform";
export class Glyph {
@ -66,6 +66,10 @@ export class Glyph {
if (!this._m_dependencyManager) return;
this._m_dependencyManager.addDependency(this, glyph);
}
hasDependency(other) {
if (!this._m_dependencyManager) return false;
return this._m_dependencyManager.hasGlyphToGlyphDependency(this, other);
}
// Copying
cloneFromGlyph(g) {
@ -138,6 +142,7 @@ export class Glyph {
}
tryBecomeMirrorOf(dst, rankSet) {
if (rankSet.has(this) || rankSet.has(dst)) return;
if (dst.hasDependency(this)) return;
const csThis = this.geometry.unlinkReferences().toShapeStringOrNull();
const csDst = dst.geometry.unlinkReferences().toShapeStringOrNull();
if (csThis && csDst && csThis === csDst) {