tall, condensed bitmap font for geeks

Begin support for hidpi

+59 -11
+47
doubler.py
··· 1 + #!/usr/bin/env python3 2 + 3 + import sys 4 + 5 + from bdflib import reader, writer, model 6 + 7 + 8 + def 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 + 30 + bdf = reader.read_bdf(sys.stdin) 31 + 32 + double_bdf = model.Font(bdf['FACE_NAME'], 33 + bdf['POINT_SIZE'], 34 + bdf['RESOLUTION_X'], 35 + bdf['RESOLUTION_Y']) 36 + 37 + for 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 + 47 + writer.write_bdf(double_bdf, sys.stdout)
+9 -8
scientifica-11.bdf
··· 535 535 F0 536 536 80 537 537 80 538 - C0 538 + E0 539 539 80 540 540 80 541 541 80 ··· 562 562 BITMAP 563 563 90 564 564 90 565 - F0 566 565 90 566 + F0 567 567 90 568 568 90 569 569 90 ··· 707 707 90 708 708 E0 709 709 A0 710 - A0 710 + 90 711 711 90 712 712 ENDCHAR 713 713 STARTCHAR S ··· 905 905 70 906 906 90 907 907 90 908 - 90 909 - 70 908 + B0 909 + 50 910 910 ENDCHAR 911 911 STARTCHAR b 912 912 ENCODING 98 ··· 1286 1286 ENCODING 126 1287 1287 SWIDTH 454 0 1288 1288 DWIDTH 5 0 1289 - BBX 4 2 0 2 1289 + BBX 5 3 0 2 1290 1290 BITMAP 1291 - 50 1292 - A0 1291 + 40 1292 + A8 1293 + 10 1293 1294 ENDCHAR 1294 1295 STARTCHAR uni00A0 1295 1296 ENCODING 160
+3 -3
scientifica.sfd
··· 45 45 DisplaySize: 11 46 46 AntiAlias: 1 47 47 FitToEm: 0 48 - WinInfo: 0 44 15 48 + WinInfo: 44 44 15 49 49 OnlyBitmaps: 1 50 50 BeginPrivate: 0 51 51 EndPrivate ··· 8166 8166 J:N0#J:N.M 8167 8167 BDFChar: 93 125 5 0 4 -1 7 8168 8168 ^`XaB(a'qD^]4?7 8169 - BDFChar: 94 126 5 0 4 2 3 8170 - BTN2o 8169 + BDFChar: 94 126 5 0 4 2 4 8170 + 5c>4o 8171 8171 BDFChar: 95 160 5 0 0 0 0 8172 8172 z 8173 8173 BDFChar: 96 161 5 2 2 0 7