Code Monkey home page Code Monkey logo

bitmapfont2otb's Issues

.bcf to .otb error

I just git clone the repo and then I run the command bitmapfont2otbTamsyn5x9b.pcfTamsyn5x9b.otb and I get this error. Converting the same file to otf or ttf works fine.

Traceback (most recent call last):
  File "/usr/local/bin/bitmapfont2otb", line 48, in <module>
    out_ext[-1] = "f"
TypeError: 'str' object does not support item assignment

KeyError: b'QUAD_WIDTH' when trying to convert gohufont-uni-14.bdf

The exact command is

bitmapfont2otb gohufont-uni-14.bdf gohufont-uni-14.otb

and the output I got is

Changing glyph name nbspace to uni00A0 (because encoding is U+00A0 && !altuni)
Changing glyph name softhyphen to uni00AD (because encoding is U+00AD && !altuni)
Changing glyph name twosuperior to uni00B2 (because encoding is U+00B2 && !altuni)
Changing glyph name threesuperior to uni00B3 (because encoding is U+00B3 && !altuni)
Changing glyph name onesuperior to uni00B9 (because encoding is U+00B9 && !altuni)
Changing glyph name Tcedilla to uni0162 (because encoding is U+0162 && !altuni)
Changing glyph name tcedilla to uni0163 (because encoding is U+0163 && !altuni)
Changing glyph name Schwa to uni018F (because encoding is U+018F && !altuni)
Changing glyph name Ezh to uni01B7 (because encoding is U+01B7 && !altuni)
Changing glyph name Tcommaaccent to uni0162 (because encoding is U+0162 && !altuni)
Changing glyph name tcommaaccent to uni0163 (because encoding is U+0163 && !altuni)
Changing glyph name dotlessj to uni0237 (because encoding is U+0237 && !altuni)
Changing glyph name schwa to uni0259 (because encoding is U+0259 && !altuni)
Changing glyph name ezh to uni0292 (because encoding is U+0292 && !altuni)
Changing glyph name commaturnedmod to uni02BB (because encoding is U+02BB && !altuni)
Changing glyph name afii57929 to uni02BC (because encoding is U+02BC && !altuni)
Changing glyph name afii64937 to uni02BD (because encoding is U+02BD && !altuni)
Changing glyph name mugreek to uni03BC (because encoding is U+03BC && !altuni)
Changing glyph name afii10023 to uni0401 (because encoding is U+0401 && !altuni)
Changing glyph name afii10051 to uni0402 (because encoding is U+0402 && !altuni)
Changing glyph name afii10052 to uni0403 (because encoding is U+0403 && !altuni)
Changing glyph name afii10053 to uni0404 (because encoding is U+0404 && !altuni)
Changing glyph name afii10054 to uni0405 (because encoding is U+0405 && !altuni)
Changing glyph name afii10055 to uni0406 (because encoding is U+0406 && !altuni)
Changing glyph name afii10056 to uni0407 (because encoding is U+0407 && !altuni)
Changing glyph name afii10057 to uni0408 (because encoding is U+0408 && !altuni)
Changing glyph name afii10058 to uni0409 (because encoding is U+0409 && !altuni)
Changing glyph name afii10059 to uni040A (because encoding is U+040A && !altuni)
Changing glyph name afii10060 to uni040B (because encoding is U+040B && !altuni)
Changing glyph name afii10061 to uni040C (because encoding is U+040C && !altuni)
Changing glyph name afii10062 to uni040E (because encoding is U+040E && !altuni)
Changing glyph name afii10145 to uni040F (because encoding is U+040F && !altuni)
Changing glyph name afii10017 to uni0410 (because encoding is U+0410 && !altuni)
Changing glyph name afii10018 to uni0411 (because encoding is U+0411 && !altuni)
Changing glyph name afii10019 to uni0412 (because encoding is U+0412 && !altuni)
Changing glyph name afii10020 to uni0413 (because encoding is U+0413 && !altuni)
Changing glyph name afii10021 to uni0414 (because encoding is U+0414 && !altuni)
Changing glyph name afii10022 to uni0415 (because encoding is U+0415 && !altuni)
Changing glyph name afii10024 to uni0416 (because encoding is U+0416 && !altuni)
Changing glyph name afii10025 to uni0417 (because encoding is U+0417 && !altuni)
Changing glyph name afii10026 to uni0418 (because encoding is U+0418 && !altuni)
Changing glyph name afii10027 to uni0419 (because encoding is U+0419 && !altuni)
Changing glyph name afii10028 to uni041A (because encoding is U+041A && !altuni)
Changing glyph name afii10029 to uni041B (because encoding is U+041B && !altuni)
Changing glyph name afii10030 to uni041C (because encoding is U+041C && !altuni)
Changing glyph name afii10031 to uni041D (because encoding is U+041D && !altuni)
Changing glyph name afii10032 to uni041E (because encoding is U+041E && !altuni)
Changing glyph name afii10033 to uni041F (because encoding is U+041F && !altuni)
Changing glyph name afii10034 to uni0420 (because encoding is U+0420 && !altuni)
Changing glyph name afii10035 to uni0421 (because encoding is U+0421 && !altuni)
Changing glyph name afii10036 to uni0422 (because encoding is U+0422 && !altuni)
Changing glyph name afii10037 to uni0423 (because encoding is U+0423 && !altuni)
Changing glyph name afii10038 to uni0424 (because encoding is U+0424 && !altuni)
Changing glyph name afii10039 to uni0425 (because encoding is U+0425 && !altuni)
Changing glyph name afii10040 to uni0426 (because encoding is U+0426 && !altuni)
Changing glyph name afii10041 to uni0427 (because encoding is U+0427 && !altuni)
Changing glyph name afii10042 to uni0428 (because encoding is U+0428 && !altuni)
Changing glyph name afii10043 to uni0429 (because encoding is U+0429 && !altuni)
Changing glyph name afii10044 to uni042A (because encoding is U+042A && !altuni)
Changing glyph name afii10045 to uni042B (because encoding is U+042B && !altuni)
Changing glyph name afii10046 to uni042C (because encoding is U+042C && !altuni)
Changing glyph name afii10047 to uni042D (because encoding is U+042D && !altuni)
Changing glyph name afii10048 to uni042E (because encoding is U+042E && !altuni)
Changing glyph name afii10049 to uni042F (because encoding is U+042F && !altuni)
Changing glyph name afii10065 to uni0430 (because encoding is U+0430 && !altuni)
Changing glyph name afii10066 to uni0431 (because encoding is U+0431 && !altuni)
Changing glyph name afii10067 to uni0432 (because encoding is U+0432 && !altuni)
Changing glyph name afii10068 to uni0433 (because encoding is U+0433 && !altuni)
Changing glyph name afii10069 to uni0434 (because encoding is U+0434 && !altuni)
Changing glyph name afii10070 to uni0435 (because encoding is U+0435 && !altuni)
Changing glyph name afii10072 to uni0436 (because encoding is U+0436 && !altuni)
Changing glyph name afii10073 to uni0437 (because encoding is U+0437 && !altuni)
Changing glyph name afii10074 to uni0438 (because encoding is U+0438 && !altuni)
Changing glyph name afii10075 to uni0439 (because encoding is U+0439 && !altuni)
Changing glyph name afii10076 to uni043A (because encoding is U+043A && !altuni)
Changing glyph name afii10077 to uni043B (because encoding is U+043B && !altuni)
Changing glyph name afii10078 to uni043C (because encoding is U+043C && !altuni)
Changing glyph name afii10079 to uni043D (because encoding is U+043D && !altuni)
Changing glyph name afii10080 to uni043E (because encoding is U+043E && !altuni)
Changing glyph name afii10081 to uni043F (because encoding is U+043F && !altuni)
Changing glyph name afii10082 to uni0440 (because encoding is U+0440 && !altuni)
Changing glyph name afii10083 to uni0441 (because encoding is U+0441 && !altuni)
Changing glyph name afii10084 to uni0442 (because encoding is U+0442 && !altuni)
Changing glyph name afii10085 to uni0443 (because encoding is U+0443 && !altuni)
Changing glyph name afii10086 to uni0444 (because encoding is U+0444 && !altuni)
Changing glyph name afii10087 to uni0445 (because encoding is U+0445 && !altuni)
Changing glyph name afii10088 to uni0446 (because encoding is U+0446 && !altuni)
Changing glyph name afii10089 to uni0447 (because encoding is U+0447 && !altuni)
Changing glyph name afii10090 to uni0448 (because encoding is U+0448 && !altuni)
Changing glyph name afii10091 to uni0449 (because encoding is U+0449 && !altuni)
Changing glyph name afii10092 to uni044A (because encoding is U+044A && !altuni)
Changing glyph name afii10093 to uni044B (because encoding is U+044B && !altuni)
Changing glyph name afii10094 to uni044C (because encoding is U+044C && !altuni)
Changing glyph name afii10095 to uni044D (because encoding is U+044D && !altuni)
Changing glyph name afii10096 to uni044E (because encoding is U+044E && !altuni)
Changing glyph name afii10097 to uni044F (because encoding is U+044F && !altuni)
Changing glyph name afii10071 to uni0451 (because encoding is U+0451 && !altuni)
Changing glyph name afii10099 to uni0452 (because encoding is U+0452 && !altuni)
Changing glyph name afii10100 to uni0453 (because encoding is U+0453 && !altuni)
Changing glyph name afii10101 to uni0454 (because encoding is U+0454 && !altuni)
Changing glyph name afii10102 to uni0455 (because encoding is U+0455 && !altuni)
Changing glyph name afii10103 to uni0456 (because encoding is U+0456 && !altuni)
Changing glyph name afii10104 to uni0457 (because encoding is U+0457 && !altuni)
Changing glyph name afii10105 to uni0458 (because encoding is U+0458 && !altuni)
Changing glyph name afii10106 to uni0459 (because encoding is U+0459 && !altuni)
Changing glyph name afii10107 to uni045A (because encoding is U+045A && !altuni)
Changing glyph name afii10108 to uni045B (because encoding is U+045B && !altuni)
Changing glyph name afii10109 to uni045C (because encoding is U+045C && !altuni)
Changing glyph name afii10110 to uni045E (because encoding is U+045E && !altuni)
Changing glyph name afii10193 to uni045F (because encoding is U+045F && !altuni)
Changing glyph name afii10050 to uni0490 (because encoding is U+0490 && !altuni)
Changing glyph name afii10098 to uni0491 (because encoding is U+0491 && !altuni)
Changing glyph name afii10846 to uni04D9 (because encoding is U+04D9 && !altuni)
Changing glyph name Klinebelow to uni1E34 (because encoding is U+1E34 && !altuni)
Changing glyph name klinebelow to uni1E35 (because encoding is U+1E35 && !altuni)
Changing glyph name Edotbelow to uni1EB8 (because encoding is U+1EB8 && !altuni)
Changing glyph name edotbelow to uni1EB9 (because encoding is U+1EB9 && !altuni)
Changing glyph name Etilde to uni1EBC (because encoding is U+1EBC && !altuni)
Changing glyph name etilde to uni1EBD (because encoding is U+1EBD && !altuni)
Changing glyph name Odotbelow to uni1ECC (because encoding is U+1ECC && !altuni)
Changing glyph name odotbelow to uni1ECD (because encoding is U+1ECD && !altuni)
Changing glyph name Ytilde to uni1EF8 (because encoding is U+1EF8 && !altuni)
Changing glyph name ytilde to uni1EF9 (because encoding is U+1EF9 && !altuni)
Changing glyph name enspace to uni2002 (because encoding is U+2002 && !altuni)
Changing glyph name hyphentwo to uni2010 (because encoding is U+2010 && !altuni)
Changing glyph name afii00208 to uni2015 (because encoding is U+2015 && !altuni)
Changing glyph name dblverticalbar to uni2016 (because encoding is U+2016 && !altuni)
Changing glyph name overline to uni203E (because encoding is U+203E && !altuni)
Changing glyph name nsuperior to uni207F (because encoding is U+207F && !altuni)
Changing glyph name afii61352 to uni2116 (because encoding is U+2116 && !altuni)
Changing glyph name Ohm to Omega (because encoding is U+2126 && !altuni)
Changing glyph name increment to Delta (because encoding is U+2206 && !altuni)
Changing glyph name bulletoperator to uni2219 (because encoding is U+2219 && !altuni)
Changing glyph name blackdiamond to uni25C6 (because encoding is U+25C6 && !altuni)
+---------------------+-------------------------+
|     BDF Property    |          Value          |
+---------------------+-------------------------+
|       FOUNDRY       |           Gohu          |
|     FAMILY_NAME     |         GohuFont        |
|     WEIGHT_NAME     |          Medium         |
|        SLANT        |            R            |
|    SETWIDTH_NAME    |          Normal         |
|    ADD_STYLE_NAME   |                         |
|      PIXEL_SIZE     |            14           |
|      POINT_SIZE     |           100           |
|     RESOLUTION_X    |           100           |
|     RESOLUTION_Y    |           100           |
|       SPACING       |            C            |
|    AVERAGE_WIDTH    |            80           |
|   CHARSET_REGISTRY  |         ISO10646        |
|   CHARSET_ENCODING  |            1            |
|  FONTNAME_REGISTRY  |                         |
|      FONT_NAME      |         GohuFont        |
|      FACE_NAME      |         GohuFont        |
|     FONT_VERSION    |         001.000         |
|     FONT_ASCENT     |            11           |
|     FONT_DESCENT    |            3            |
|  UNDERLINE_POSITION |            -1           |
| UNDERLINE_THICKNESS |            1            |
|       X_HEIGHT      |            7            |
|      CAP_HEIGHT     |            9            |
|      RAW_ASCENT     |           785           |
|     RAW_DESCENT     |           215           |
|      NORM_SPACE     |            8            |
|     FIGURE_WIDTH    |            8            |
| AVG_LOWERCASE_WIDTH |            80           |
| AVG_UPPERCASE_WIDTH |            80           |
|     _GBDFED_INFO    | Edited with gbdfed 1.6. |
+---------------------+-------------------------+
Traceback (most recent call last):
  File "/home/averms/Sources/others/bitmapfont2otb/bitmapfont2otb", line 101, in <module>
    quad_width = bdf.properties[b"QUAD_WIDTH"]
KeyError: b'QUAD_WIDTH'

fontforge module not loading bitmap strikes (X11 fonts)

While poking around conversion options for old X11 bitmap fonts, I encountered quite a few cases where bitmapfont2otb fails to complete the conversion, raising OSError: Could not load bitmap font at line 84. That seems to be the fontforge Python module.

This was starting with the PCF version. Before hitting that error, it's actually complaining about not being able to find/open the requested outfile name with a BDF extension. But the script is creating an intermediate BDF -- which survives and can be opened successfully in FF and can be converted directly to OTB with bitmapfont2otb.

e.g., running:

./bitmapfont2otb teletext2i.pcf teletext2i-pcf.otb

(in a venv) gives us:

Couldn't open file ./teletext2i-pcf.bdf
Could not find a bitmap font in .
Traceback (most recent call last):
  File "/home/nate/code/bitmapfont2otb/./bitmapfont2otb", line 84, in <module>
    f.importBitmaps(out_bdf, True)
OSError: Could not load bitmap font

but that does leave ./teletext2i-pcf-20.bdf, which converts OK. (Modulo glyph renaming etc._

Might be my own lack of working with the fontforge Python module, but a first guess is that the extraction of the strike is confusing it. Don't know; curious if this has been encountered before.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.