Revert: Update D.js

This commit is contained in:
2025-11-09 12:29:14 -08:00
parent 7c8917fbd8
commit 531edcffee

View File

@@ -1,59 +1,61 @@
const makeGlyph=(opentype,name,unicode,cmds,adv)=>
new opentype.Glyph({name,unicode,advanceWidth:adv,path:cmds(new opentype.Path())});
const makeGlyph = (opentype, name, unicode, cmds, adv) =>
new opentype.Glyph({
name,
unicode,
advanceWidth: adv,
path: cmds(new opentype.Path())
});
export const glyphD=(opentype,adv)=>
export const glyphD = (opentype, adv) =>
makeGlyph(
opentype,
"D",
"D".codePointAt(0),
p=>{
const x0=120,x1=190,top=700,bot=0;
const cx=330,ro=260,ri=200;
p.moveTo(x0,bot);
p.lineTo(x0,top);
p.lineTo(cx+ro-40,top);
p.curveTo(cx+ro,top,cx+ro,top-60,cx+ro,top-150);
p.lineTo(cx+ro,150);
p.curveTo(cx+ro,60,cx+ro-40,bot,cx+ro-100,bot);
p.lineTo(x0,bot);
(p) => {
p.moveTo(100, 0);
p.lineTo(100, 700);
p.lineTo(320, 700);
p.curveTo(480, 700, 580, 590, 580, 420);
p.lineTo(580, 280);
p.curveTo(580, 110, 480, 0, 320, 0);
p.close();
p.moveTo(x1,70);
p.lineTo(x1,630);
p.lineTo(cx+ri+40,630);
p.curveTo(cx+ri+90,630,cx+ri+90,580,cx+ri+90,520);
p.lineTo(cx+ri+90,180);
p.curveTo(cx+ri+90,120,cx+ri+40,70,cx+ri,70);
p.lineTo(x1,70);
p.moveTo(160, 60);
p.lineTo(320, 60);
p.curveTo(450, 60, 520, 140, 520, 280);
p.lineTo(520, 420);
p.curveTo(520, 560, 450, 640, 320, 640);
p.lineTo(160, 640);
p.close();
return p;
},
adv
);
export const glyphd=(opentype,adv)=>
export const glyphd = (opentype, adv) =>
makeGlyph(
opentype,
"d",
"d".codePointAt(0),
p=>{
const cx=310;
p.moveTo(430,0);
p.lineTo(370,0);
p.lineTo(370,80);
p.curveTo(340,20,300,-10,240,-10);
p.curveTo(150,-10,90,70,90,200);
p.curveTo(90,330,150,410,240,410);
p.curveTo(300,410,340,380,370,330);
p.lineTo(370,720);
p.lineTo(430,720);
(p) => {
p.moveTo(310, -10);
p.curveTo(250, -10, 200, 10, 160, 40);
p.lineTo(160, 0);
p.lineTo(100, 0);
p.lineTo(100, 720);
p.lineTo(160, 720);
p.lineTo(160, 440);
p.curveTo(200, 470, 250, 490, 310, 490);
p.curveTo(430, 490, 520, 400, 520, 240);
p.curveTo(520, 80, 430, -10, 310, -10);
p.close();
p.moveTo(240,50);
p.curveTo(320,50,370,120,370,200);
p.curveTo(370,280,320,350,240,350);
p.curveTo(160,350,120,280,120,200);
p.curveTo(120,120,160,50,240,50);
p.moveTo(310, 50);
p.curveTo(400, 50, 460, 110, 460, 240);
p.curveTo(460, 370, 400, 430, 310, 430);
p.curveTo(220, 430, 160, 370, 160, 240);
p.curveTo(160, 110, 220, 50, 310, 50);
p.close();
return p;
},
adv
);