aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNerdyPepper <[email protected]>2018-02-02 17:09:56 +0000
committerNerdyPepper <[email protected]>2018-02-02 17:09:56 +0000
commit0eebe4250e143a85d7423b79c36bf5a041e76e12 (patch)
treedb32ff04a46fbc5766f257f59926b4686c2737ed
parent079671292e63524757b5d7f8b0e16c11cad3f69e (diff)
Begin support for hidpi
-rw-r--r--doubler.py47
-rw-r--r--scientifica-11.bdf17
-rw-r--r--scientifica.sfd6
3 files changed, 59 insertions, 11 deletions
diff --git a/doubler.py b/doubler.py
new file mode 100644
index 0000000..6be9f6c
--- /dev/null
+++ b/doubler.py
@@ -0,0 +1,47 @@
1#!/usr/bin/env python3
2
3import sys
4
5from bdflib import reader, writer, model
6
7
8def double_glyph_data(gd):
9 ret = []
10 for gl in gd:
11 # get the bits in each line
12 glh = int(gl, 16)
13 bits = bin(glh)[2:]
14 double_bits = []
15 for bit in bits:
16 # output two bits for each bit in the line
17 double_bits.append(bit)
18 double_bits.append(bit)
19 double_bits = ''.join(double_bits)
20 double_glh = int(double_bits, 2)
21 double_gl = hex(double_glh)[2:].upper()
22 # must 0-pad to two times the length of the original lines
23 double_gl = "0" * (len(gl) * 2 - len(double_gl)) + double_gl
24 # output the line two times
25 ret.append(double_gl)
26 ret.append(double_gl)
27 return ret
28
29
30bdf = reader.read_bdf(sys.stdin)
31
32double_bdf = model.Font(bdf['FACE_NAME'],
33 bdf['POINT_SIZE'],
34 bdf['RESOLUTION_X'],
35 bdf['RESOLUTION_Y'])
36
37for g in bdf.glyphs_by_codepoint.values():
38 double_bdf.new_glyph_from_data(g.name,
39 double_glyph_data(g.get_data()),
40 g.bbX * 2,
41 g.bbY * 2,
42 g.bbW * 2,
43 g.bbH * 2,
44 g.advance * 2,
45 g.codepoint)
46
47writer.write_bdf(double_bdf, sys.stdout)
diff --git a/scientifica-11.bdf b/scientifica-11.bdf
index 90882f1..d431345 100644
--- a/scientifica-11.bdf
+++ b/scientifica-11.bdf
@@ -535,7 +535,7 @@ BITMAP
535F0 535F0
53680 53680
53780 53780
538C0 538E0
53980 53980
54080 54080
54180 54180
@@ -562,8 +562,8 @@ BBX 4 7 0 0
562BITMAP 562BITMAP
56390 56390
56490 56490
565F0
56690 56590
566F0
56790 56790
56890 56890
56990 56990
@@ -707,7 +707,7 @@ E0
70790 70790
708E0 708E0
709A0 709A0
710A0 71090
71190 71190
712ENDCHAR 712ENDCHAR
713STARTCHAR S 713STARTCHAR S
@@ -905,8 +905,8 @@ BITMAP
90570 90570
90690 90690
90790 90790
90890 908B0
90970 90950
910ENDCHAR 910ENDCHAR
911STARTCHAR b 911STARTCHAR b
912ENCODING 98 912ENCODING 98
@@ -1286,10 +1286,11 @@ STARTCHAR asciitilde
1286ENCODING 126 1286ENCODING 126
1287SWIDTH 454 0 1287SWIDTH 454 0
1288DWIDTH 5 0 1288DWIDTH 5 0
1289BBX 4 2 0 2 1289BBX 5 3 0 2
1290BITMAP 1290BITMAP
129150 129140
1292A0 1292A8
129310
1293ENDCHAR 1294ENDCHAR
1294STARTCHAR uni00A0 1295STARTCHAR uni00A0
1295ENCODING 160 1296ENCODING 160
diff --git a/scientifica.sfd b/scientifica.sfd
index bfb0ba8..8e0ea10 100644
--- a/scientifica.sfd
+++ b/scientifica.sfd
@@ -45,7 +45,7 @@ NameList: AGL For New Fonts
45DisplaySize: 11 45DisplaySize: 11
46AntiAlias: 1 46AntiAlias: 1
47FitToEm: 0 47FitToEm: 0
48WinInfo: 0 44 15 48WinInfo: 44 44 15
49OnlyBitmaps: 1 49OnlyBitmaps: 1
50BeginPrivate: 0 50BeginPrivate: 0
51EndPrivate 51EndPrivate
@@ -8166,8 +8166,8 @@ BDFChar: 92 124 5 2 2 0 6
8166J:N0#J:N.M 8166J:N0#J:N.M
8167BDFChar: 93 125 5 0 4 -1 7 8167BDFChar: 93 125 5 0 4 -1 7
8168^`XaB(a'qD^]4?7 8168^`XaB(a'qD^]4?7
8169BDFChar: 94 126 5 0 4 2 3 8169BDFChar: 94 126 5 0 4 2 4
8170BTN2o 81705c>4o
8171BDFChar: 95 160 5 0 0 0 0 8171BDFChar: 95 160 5 0 0 0 0
8172z 8172z
8173BDFChar: 96 161 5 2 2 0 7 8173BDFChar: 96 161 5 2 2 0 7