Skip to content

Commit

Permalink
Little changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RanolP committed Dec 14, 2020
1 parent 359a610 commit 577a738
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
working-directory: ./generator
run: npm run build:release
env:
ARTIFACT_DOWNLOAD_TOKEN: ${{ secrets.ARTIFACT_DOWNLOAD_TOKEN }}
ARTIFACT_DOWNLOAD_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}

- name: Create Artifacts
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -97,3 +97,8 @@ jobs:
asset_path: ./dalmoori.zip
asset_name: dalmoori-font.zip
asset_content_type: application/zip
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
event-type: update-page
4 changes: 2 additions & 2 deletions generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"license": "MIT OR Apache-2.0",
"devDependencies": {
"@types/eslint": "^7.2.6",
"@types/node": "^14.14.12",
"@types/node": "^14.14.13",
"@types/node-fetch": "^2.5.7",
"@types/opentype.js": "^1.3.1",
"@types/progress": "^2.0.3",
Expand Down Expand Up @@ -49,4 +49,4 @@
"ttf2woff2": "^3.0.0",
"unidata": "^13.0.0"
}
}
}
3 changes: 3 additions & 0 deletions generator/src/generate-advancement-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ async function analyze(oldFont: Font, currentFont: Font): Promise<AnalysisResult
const changed: Array<Codepoint | null> = await execute(
function* () {
for (const codepoint of fullCodepointsOf(block)) {
if (old.has(codepoint) || current.has(codepoint)) {
continue;
}
const ch = String.fromCharCode(codepoint);
const oldGlyph = oldFont.charToGlyph(ch);
const currentGlyph = currentFont.charToGlyph(ch);
Expand Down
6 changes: 1 addition & 5 deletions generator/src/util/opentype-paper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,13 @@ function chooseProperSize(a: opentype.BoundingBox, b: opentype.BoundingBox): [wi

export function makePathsForComparison(a: opentype.Glyph, b: opentype.Glyph): [paper.Path, paper.Path, paper.Project, [width: number, height: number]] {
const size = chooseProperSize(a.getBoundingBox(), b.getBoundingBox());
const project = createProject(size[0], size[1]);
const project = createProject(...size);
const aPaperPath = toPaperPath(a, project);
const bPaperPath = toPaperPath(b, project);
return [aPaperPath, bPaperPath, project, size];
}

export function toPaperPath(input: opentype.Glyph, project: paper.Project = createProject(...getSize(input.getBoundingBox()))): paper.Path {
if (project === undefined) {
const bb = input.getBoundingBox();
project = createProject(bb.x2 - bb.x1, bb.y2 - bb.y1);
}
const output = new paper.Path({
pathData: glyphToPath(input).toSVG(0),
project,
Expand Down

0 comments on commit 577a738

Please sign in to comment.