Add more framed letters

This commit is contained in:
Belleve Invis 2020-04-02 04:05:00 -07:00
parent 9ede5a9df9
commit 368184d88c
4 changed files with 83 additions and 19 deletions

View file

@ -30,19 +30,21 @@ glyph-block AutoBuild-Enclosure : begin
if [query-glyph gni] : return [query-glyph gni]
define lg : create-glyph gni : glyph-construction
local tw 0
local firstDerivedGyph null
foreach [glyphid : items-of parts] : begin
local g miniatureFont.(glyphid)
include g
apply-transform : Translate (-g.advanceWidth) 0
set tw : tw + g.advanceWidth
local derivedGlyph miniatureFont.(glyphid)
include derivedGlyph
if [not firstDerivedGyph] : set firstDerivedGyph derivedGlyph
apply-transform : Translate (-derivedGlyph.advanceWidth) 0
set tw : tw + derivedGlyph.advanceWidth
apply-transform : Translate tw 0
apply-transform : Upright
apply-transform : Scale [Math.min 1 (width / tw)] 1
set tw : Math.min width tw
local shift 0
if (g.anchors.above && g.anchors.below) : begin
if bal : set shift : CAP / 2 - [mix baly [mix g.anchors.above.y g.anchors.below.y 0.5] bal]
: else : set shift : CAP / 2 - [mix g.anchors.above.y g.anchors.below.y 0.5]
if (firstDerivedGyph && firstDerivedGyph.anchors.above && firstDerivedGyph.anchors.below) : begin
if bal : set shift : CAP / 2 - [mix baly [mix firstDerivedGyph.anchors.above.y firstDerivedGyph.anchors.below.y 0.5] bal]
: else : set shift : CAP / 2 - [mix firstDerivedGyph.anchors.above.y firstDerivedGyph.anchors.below.y 0.5]
apply-transform : Translate (-tw / 2) (-CAP / 2 + shift)
apply-transform : Scale dscale
apply-transform : Translate (width / 2) (CAP / 2 * dscale)
@ -60,8 +62,8 @@ glyph-block AutoBuild-Enclosure : begin
define spatt : linreg WIDTH 0.175 UPM 0.27 width
define sw0 : [EnclosureStrokeScale dscale digits width] * [adviceBlackness [CircCrowd digits width]] / [CircScale digits width]
define sw : Math.max sw0 [fallback m 0]
define top : CAP * dscale + [Math.max (CAP * spatt) (sw * 3)]
define bot : 0 - [Math.max (CAP * spatt) (sw * 3)]
define top : CAP * dscale + (CAP * spatt)
define bot : 0 - (CAP * spatt)
define mosaicLeft 0
define mosaicRight width
define mosaicBot fontMetrics.OS_2.sTypoDescender
@ -345,7 +347,10 @@ glyph-block AutoBuild-Enclosure : begin
if [not recursive] : do "Double-digit circled"
local compositions : list
compositions.push { null {'markBaseSpace'} WIDE-WIDTH-1 }
list null {'markBaseSpace'} WIDE-WIDTH-1
list 0x1F16D {'C' 'C'} WIDE-WIDTH-1
list 0x1F12D {'C' 'D'} WIDE-WIDTH-1
list 0x1F12E {'W' 'z'} WIDE-WIDTH-1
foreach [j : range 10 till 20] : compositions.push : list
0x2460 + j - 1
digitGlyphNames j
@ -388,11 +393,51 @@ glyph-block AutoBuild-Enclosure : begin
foreach [j : range 0 26] : compositions.push {(0x1F130 + j) {unicodeGlyphs.(['A'.charCodeAt 0] + j).name} WIDE-WIDTH-1}
createBoxedGlyphs 1 compositions
if [not recursive] : do "double-digit boxed"
local compositions : list
list null {'markBaseSpace'} WIDE-WIDTH-1
list 0x1F14A {'H' 'V'} WIDE-WIDTH-1
list 0x1F14B {'M' 'V'} WIDE-WIDTH-1
list 0x1F14C {'S' 'D'} WIDE-WIDTH-1
list 0x1F14D {'S' 'S'} WIDE-WIDTH-1
list 0x1F14F {'W' 'C'} WIDE-WIDTH-1
list 0x1F191 {'C' 'L'} WIDE-WIDTH-1
list 0x1F194 {'I' 'D'} WIDE-WIDTH-1
list 0x1F196 {'N' 'G'} WIDE-WIDTH-1
list 0x1F197 {'O' 'K'} WIDE-WIDTH-1
list 0x1F19A {'V' 'S'} WIDE-WIDTH-1
createBoxedGlyphs 2 compositions
if [not recursive] : do "triple-digit boxed"
local compositions : list
list null {'markBaseSpace'} WIDE-WIDTH-1
list 0x1F14E {'P' 'P' 'V'} WIDE-WIDTH-1
list 0x1F195 {'N' 'E' 'W'} WIDE-WIDTH-1
list 0x1F198 {'S' 'O' 'S'} WIDE-WIDTH-1
list 0x1F199 {'U' 'P' 'exclam'} WIDE-WIDTH-1
createBoxedGlyphs 3 compositions
if [not recursive] : do "quad-digit boxed"
local compositions : list
list null {'markBaseSpace'} WIDE-WIDTH-1
list 0x1F192 {'C' 'O' 'O' 'L'} WIDE-WIDTH-1
list 0x1F193 {'F' 'R' 'E' 'E'} WIDE-WIDTH-1
createBoxedGlyphs 4 compositions
if [not recursive] : do "inset boxed"
local compositions {}
foreach [j : range 0 26] : compositions.push {(0x1F170 + j) {unicodeGlyphs.(['A'.charCodeAt 0] + j).name} WIDE-WIDTH-1}
createInsetBoxedGlyphs 1 compositions
if [not recursive] : do "double-digit inset boxed"
local compositions : list
list 0x1F18B {'I' 'C'} WIDE-WIDTH-1
list 0x1F18C {'P' 'A'} WIDE-WIDTH-1
list 0x1F18D {'S' 'A'} WIDE-WIDTH-1
list 0x1F18E {'A' 'B'} WIDE-WIDTH-1
list 0x1F18F {'W' 'C'} WIDE-WIDTH-1
createInsetBoxedGlyphs 1 compositions
if [not recursive] : do "inset mosaic"
local compositions {}
compositions.push { 0x1FBB1 { [unicodeGlyphs.(0x2714).name.replace [regex '.fwid$'] ".hwid"] } WIDE-WIDTH-2 }

View file

@ -209,6 +209,7 @@ glyph-block Autobuild-Transformed : begin
list 0x1D3D 'OU'
list 0x1D3E 'P'
list 0x1D3F 'R'
list null 'C' # there is no superscript C in unicode, but is is used for the MC symbol
list null 'S' # there is no superscript S in unicode, but is is used for the SM symbol
list 0x1D40 'T'
list 0x1D41 'U'
@ -378,6 +379,18 @@ glyph-block Autobuild-Transformed : begin
include : DoubleSuperscript [refer-glyph 'supS'] [refer-glyph 'supM']
save 'serviceMark' 0x2120
sketch # raisedMC
include : DoubleSuperscript [refer-glyph 'supM'] [refer-glyph 'supC']
save 'raisedMC' 0x1F16A
sketch # raisedMD
include : DoubleSuperscript [refer-glyph 'supM'] [refer-glyph 'supD']
save 'raisedMD' 0x1F16B
sketch # raisedMR
include : DoubleSuperscript [refer-glyph 'supM'] [refer-glyph 'supR']
save 'raisedMR' 0x1F16C
define [createFracImpl suffix records fine scaleFactor closing] : begin
local pendingGlyphs : [records.map : [record] => record.1].concat : records.map : [record] => record.2
local miniatureFont : Miniature
@ -464,7 +477,7 @@ glyph-block Autobuild-Transformed : begin
local df1 : Thinner pendingGlyphs1 shrink1
local df2 : Thinner pendingGlyphs2 shrink2
foreach [{unicode c1 c2} : items-of records] : begin
foreach [{unicode c1 c2 desiredWidth} : items-of records] : begin
local glyphName : MangleName "\(c1)_\(c2)"
if [query-glyph glyphName] : begin
local j 2
@ -476,7 +489,7 @@ glyph-block Autobuild-Transformed : begin
include df2.(c2)
include : Translate df1.(c1).advanceWidth 0
include df1.(c1)
save glyphName [MangleUnicode unicode]
save glyphName [MangleUnicode unicode desiredWidth]
: else : sketch
set-width ww
local sumChildrenWidth : df1.(c1).advanceWidth * wadj1 + df2.(c2).advanceWidth * wadj2
@ -491,7 +504,7 @@ glyph-block Autobuild-Transformed : begin
include : Scale [clamp 0 1 ((ww - SB * 1.25) / (ww - SB * 2) * ww / refW)] 1
include : Translate (ww / 2) 0
include : Italify
save glyphName [MangleUnicode unicode]
save glyphName [MangleUnicode unicode desiredWidth]
define stdShrink : clamp 0.75 0.9 : linreg 72 0.75 108 0.9 STROKE
if [not recursive] : createLigatures stdShrink stdShrink 1 1 : list
@ -524,6 +537,7 @@ glyph-block Autobuild-Transformed : begin
list 0x2047 'question' 'question'
list 0x2048 'question' 'exclam'
list 0x2049 'exclam' 'question'
list 0x1F190 'D' 'J' WIDE-WIDTH-1
if [not recursive] : createLigatures 0.7 0.8 0.75 0.9 : list
list 0x2103 'degree' 'C'
list 0x2109 'degree' 'F'

View file

@ -1354,6 +1354,7 @@ glyph-block Overmarks : begin
sketch # Spaced double mark
include [refer-glyph 'markBaseSpace'] AS_BASE
set-width [query-glyph 'markBaseSpace'].advanceWidth
include [refer-glyph id]
save ('spaced' + id) unicode
@ -1381,6 +1382,7 @@ glyph-block Overmarks : begin
sketch # spaced_psiliperispomeni
include [refer-glyph 'markBaseSpace'] AS_BASE
set-width [query-glyph 'markBaseSpace'].advanceWidth
include : refer-glyph "psiliperispomeni"
save 'spaced_psiliperispomeni' 0x1FCF
@ -1402,6 +1404,7 @@ glyph-block Overmarks : begin
sketch # spaced_dasiaperispomeni
include [refer-glyph 'markBaseSpace'] AS_BASE
set-width [query-glyph 'markBaseSpace'].advanceWidth
include : refer-glyph "dasiaperispomeni"
save 'spaced_dasiaperispomeni' 0x1FDF

View file

@ -4,12 +4,15 @@ const ugc = require("unicode-13.0.0/General_Category");
module.exports = function(rawCov) {
const result = [];
const inFontCharSet = new Set(rawCov.keys());
const glyphNameMap = new Map();
for (const [lchFont, [gn, ck]] of rawCov) {
glyphNameMap.set(lchFont, gn);
}
for (const [[lchBlockStart, lchBlockEnd], block] of blockData) {
let blockResults = [];
let processed = new Set();
for (const [lchFont, [gn, ck]] of rawCov) {
for (const [lchFont, [_gn, ck]] of rawCov) {
if (lchFont < 0x20 || lchFont < lchBlockStart || lchFont > lchBlockEnd) continue;
const lchStart = (lchFont >>> 4) << 4;
const lchEnd = lchStart + 0x10;
@ -19,11 +22,10 @@ module.exports = function(rawCov) {
const gc = ugc.get(lch);
blockResults.push({
lch,
charName: chName,
glyphName: inFontCharSet.has(lch) ? gn : undefined,
gc,
ck,
inFont: inFontCharSet.has(lch)
charName: chName,
glyphName: glyphNameMap.get(lch),
inFont: glyphNameMap.has(lch)
});
processed.add(lch);
}