Project Glyphy: a visualizer & validator tool for ProffieOS TEXT font files

If, like me, you’ve ever wondered what all the characters in your ProffieOS text fonts actually look like, then Glyphy is the tool for you.

GitHub: GitHub - olivierflying747-8/Glyphy · GitHub

This is what Glyphy can do. Example output:
Aurebesh10Font_03

StarJedi10Font_02

StarJedi10Font_04

saber_logo_01

StarJedi10Font_05

But that is not all:

  • Output formats: .bmp / .png / .jpg
  • Diagnostic overlay
  • Detect issues (incorrect uintXX_t, missing bitmap arrays / GLYPHDATA, etc.)
  • Display duplicates and commented “ghost” glyphs
  • Create OLED-friendly sized text-based .bmp

If you want to design your own text font, Glyphy can help you:

  • Validate and repair it
  • Generate a skeleton font (bare structure ready to be “artified”)
  • Fix structural issues automatically

Important:

  • Glyphy does not generate glyph art
  • Glyphy never modifies your original file (repairs are written to a clone)

It should work on Windows, macOS, and Linux (tested on Windows only). Python is required.

This started as a personal tool to inspect a single font. It quickly got out of hand.

4 Likes

If you find a “compile-error” bug, I will need a few things to reproduce it:

  • copy of the error message
  • copy of the # USER SETTINGS all the way down to # END OF USER SETTINGS
  • name / copy / link of the .h text font used

I tested and re-tested as much as I could think of but the more I added to it, the less likely I tested every single combination of modes and bools possible.

I didn’t test anything macOS or Linux related because I only have Windows.
The OS specific features are:

  • AUTO_OPEN renders and reports: AUTO_OPEN_IMAGE = True & AUTO_OPEN_REPORT = True
  • find system TTF for labels & legend
  • CLI menu based single key inputs from the repair tool: OPEN_REPAIR_MENU = True. If no errors are found in your font, repair menu will not prompt to open. If you want to see it, just change one uint16_t to uint17_t.

I made Glyphy very resilient to render “malformed” bitmap arrays. Glyphy can render:

0b0101UL, <-- standard format, duh
0b0101, <-- missing 'UL'
0101UL, <-- missing '0b'
0101, <-- missing '0b' & 'UL'
0101 , <-- missing '0b', 'UL' & extra space

What Glyphy can’t render (it used to, but I had to make it a bit stricter because the results were ugly → everything was placed on one column):

0b0101UL  <-- no comma ','
0b1010UL 

As long as there are binaries separated by commas “,” Glyphy can render them.

I’ll appreciate any feedback or suggestion. Thank you for trying Glyphy.

MTFBWY

1 Like

I created two more tools to help edit Glyphs:

asciify.py will create asciified.txt:
from

0b000000000000000000UL,
0b000001111111100000UL,
0b000110100010111000UL,
0b001101111111101100UL,
0b011011111111110110UL,
0b010011001100110010UL,
0b110111101101111011UL,
0b111111100001111111UL,
0b101101100001101101UL,
0b111100000000001111UL,
0b101111100001111101UL,
0b100111100001111011UL,
0b010111001100111010UL,
0b010011001110110010UL,
0b001011111111110100UL,
0b000101111111101000UL,
0b000011000001110000UL,
0b000000111111000000UL

to

LLLLLLLLLLLLLLLLLL
UUUUUUUUUUUUUUUUUU
      ██████
    ████ █ ███
   ██  ████   █
  ██  ███████  █
  █ ████  █████ █
 ████████ ███████
 █ ██ ███ ██  ████
 ████        ███ █
 █ ████     ████ █
 █ ████     ████ █
 █ ██         ██ █
 ████ ███ ██  ██ █
 █ ██████ ███████
  █ ████  █████ █
  ██  ███████  █
   ██  ████   █
    ████ █  ██
      ██████
bbbbbbbbbbbbbbbbbb
000000000000000000

The glyph can be edited to, for example:

LLLLLLLLLLLLLLLLL
UUUUUUUUUUUUUUUUU
     ███████
   ███  █  ███
  ██   ███   ██
 ██   █████   ██
 █  ████ ████  █
████████ ████████
█ ██ ██   ██ ██ █
█ ███       ███ █
█ ████     ████ █
█ ████     ████ █
█ ███       ███ █
█ ██ ██   ██ ██ █
████████ ████████
 █  ████ ████  █
 ██   █████   ██
  ██   ███   ██
   ███  █  ███
     ███████
bbbbbbbbbbbbbbbbb
00000000000000000

I am no artist, but IMHO, the second one looks a lot less like a squashed bug and more like an imperial logo.
use deasciify.py to read asciified.txt and create deascified.txt:

0b000001111111100000UL,
0b000111000000111000UL,
0b001101111111101100UL,
0b011001111111100110UL,
0b010011011110110010UL,
0b110011101101110011UL,
0b100111100001111001UL,
0b101111000000111101UL,
0b111100000000001111UL,
0b101111000000111101UL,
0b100111100001111001UL,
0b110011101101110011UL,
0b010011011110110010UL,
0b011001111111100110UL,
0b001101111111101100UL,
0b000111000000111000UL,
0b000001111111100000UL

  uint32_t

  Glyph height: 22
  Glyph width: 17

added bonus, deasciify.py will also calculate the size of the new glyph to help update GLYPHDATA, if needed.

And this is a before/after comparaison of some of the StarJedi10Font.h characters that I edited on my ProffieOS (the white ones are new, the grey ones are the old ones that I left as commented glyphs):

I did the same to Aurebesh10Font.h:
Aurebesh10Font_14
The “|” & “~” characters seem to be place holders (I am thinking to try and make republic & Sith symbols)

@profezzorn: are you interested in any of these changes to be added to master OS? I didn’t change the sizes of any glyphs, as to not “break” any configs.

In StarJedi10Font.h 38 characters have an advance width narrower than their glyph width making them slightly overlap with the next glyph. Is that on purpose ? The “<” (char28) draws an underscore that underlines the previous character, so I believe that one is on purpose.

This is an edited version of a Glyphy font analysis report:

==============================================================
================ GLYPHY FONT ANALYSIS REPORT: ================
==============================================================

Font name: StarJedi10Font.h

==================== GLYPHY FONT DETAILS: ====================

char11 - '+':
  [INFO] advance width (14) smaller than bitmap width (16)
    line: 1589
    suggestion: replace '{14, -1, -13}' with '{16, -1, -13}'

char15 - '/':
  [INFO] advance width (7) smaller than bitmap width (9)
    line: 1593
    suggestion: replace '{7, -1, -13}' with '{9, -1, -13}'

char27 - ';':
  [INFO] advance width (13) smaller than bitmap width (17)
    line: 1605
    suggestion: replace '{13, 0, -13}' with '{17, 0, -13}'

char29 - '=':
  [INFO] advance width (14) smaller than bitmap width (16)
    line: 1607
    suggestion: replace '{14, -1, -3}' with '{16, -1, -3}'

char32 - '@':
  [INFO] advance width (52) smaller than bitmap width (60)
    line: 1610
    suggestion: replace '{52, -9, -23}' with '{60, -9, -23}'

char33 - 'A':
  [INFO] advance width (14) smaller than bitmap width (16)
    line: 1611
    suggestion: replace '{14, -1, -13}' with '{16, -1, -13}'

char34 - 'B':
  [INFO] advance width (16) smaller than bitmap width (18)
    line: 1612
    suggestion: replace '{16, -3, -13}' with '{18, -3, -13}'

char36 - 'D':
  [INFO] advance width (16) smaller than bitmap width (18)
    line: 1614
    suggestion: replace '{16, -3, -13}' with '{18, -3, -13}'

char37 - 'E':
  [INFO] advance width (13) smaller than bitmap width (16)
    line: 1615
    suggestion: replace '{13, -2, -13}' with '{16, -2, -13}'

char38 - 'F':
  [INFO] advance width (13) smaller than bitmap width (14)
    line: 1616
    suggestion: replace '{13, -2, -13}' with '{14, -2, -13}'

char40 - 'H':
  [INFO] advance width (14) smaller than bitmap width (16)
    line: 1618
    suggestion: replace '{14, -3, -13}' with '{16, -3, -13}'

char41 - 'I':
  [INFO] advance width (14) smaller than bitmap width (17)
    line: 1619
    suggestion: replace '{14, 0, -13}' with '{17, 0, -13}'

char42 - 'J':
  [INFO] advance width (9) smaller than bitmap width (10)
    line: 1620
    suggestion: replace '{9, 0, -13}' with '{10, 0, -13}'

char43 - 'K':
  [INFO] advance width (13) smaller than bitmap width (16)
    line: 1621
    suggestion: replace '{13, 1, -13}' with '{16, 1, -13}'

char44 - 'L':
  [INFO] advance width (13) smaller than bitmap width (14)
    line: 1622
    suggestion: replace '{13, -2, -13}' with '{14, -2, -13}'

char45 - 'M':
  [INFO] advance width (17) smaller than bitmap width (19)
    line: 1623
    suggestion: replace '{17, -3, -13}' with '{19, -3, -13}'

char46 - 'N':
  [INFO] advance width (15) smaller than bitmap width (17)
    line: 1624
    suggestion: replace '{15, 1, -13}' with '{17, 1, -13}'

char47 - 'O':
  [INFO] advance width (15) smaller than bitmap width (16)
    line: 1625
    suggestion: replace '{15, -2, -13}' with '{16, -2, -13}'

char48 - 'P':
  [INFO] advance width (14) smaller than bitmap width (17)
    line: 1626
    suggestion: replace '{14, -2, -13}' with '{17, -2, -13}'

char49 - 'Q':
  [INFO] advance width (17) smaller than bitmap width (20)
    line: 1627
    suggestion: replace '{17, 0, -13}' with '{20, 0, -13}'

char50 - 'R':
  [INFO] advance width (15) smaller than bitmap width (18)
    line: 1628
    suggestion: replace '{15, 1, -13}' with '{18, 1, -13}'

char51 - 'S':
  [INFO] advance width (11) smaller than bitmap width (17)
    line: 1629
    suggestion: replace '{11, -5, -13}' with '{17, -5, -13}'

char52 - 'T':
  [INFO] advance width (10) smaller than bitmap width (12)
    line: 1630
    suggestion: replace '{10, -1, -13}' with '{12, -1, -13}'

char55 - 'W':
  [INFO] advance width (17) smaller than bitmap width (21)
    line: 1633
    suggestion: replace '{17, -2, -13}' with '{21, -2, -13}'

char57 - 'Y':
  [INFO] advance width (14) smaller than bitmap width (17)
    line: 1635
    suggestion: replace '{14, -1, -13}' with '{17, -1, -13}'

char58 - 'Z':
  [INFO] advance width (14) smaller than bitmap width (16)
    line: 1636
    suggestion: replace '{14, -1, -13}' with '{16, -1, -13}'

char59 - '[':
  [INFO] advance width (13) smaller than bitmap width (19)
    line: 1637
    suggestion: replace '{13, -2, -13}' with '{19, -2, -13}'

char60 - '\':
  [INFO] advance width (1) smaller than bitmap width (6)
    line: 1638
    suggestion: replace '{1, -3, -3}' with '{6, -3, -3}'

char61 - ']':
  [INFO] advance width (17) smaller than bitmap width (22)
    line: 1639
    suggestion: replace '{17, -1, -13}' with '{22, -1, -13}'

char63 - '_':
  [INFO] advance width (15) smaller than bitmap width (17)
    line: 1641
    suggestion: replace '{15, -3, -13}' with '{17, -3, -13}'

char64 - '`':
  [INFO] advance width (16) smaller than bitmap width (18)
    line: 1642
    suggestion: replace '{16, -2, -13}' with '{18, -2, -13}'

char65 - 'a':
  [INFO] advance width (14) smaller than bitmap width (16)
    line: 1643
    suggestion: replace '{14, -1, -13}' with '{16, -1, -13}'

char86 - 'v':
  [INFO] advance width (16) smaller than bitmap width (17)
    line: 1664
    suggestion: replace '{16, -1, -13}' with '{17, -1, -13}'

char87 - 'w':
  [INFO] advance width (17) smaller than bitmap width (20)
    line: 1665
    suggestion: replace '{17, -1, -13}' with '{20, -1, -13}'

char88 - 'x':
  [INFO] advance width (14) smaller than bitmap width (16)
    line: 1666
    suggestion: replace '{14, -1, -13}' with '{16, -1, -13}'

char89 - 'y':
  [INFO] advance width (14) smaller than bitmap width (17)
    line: 1667
    suggestion: replace '{14, -1, -13}' with '{17, -1, -13}'

char92 - '|':
  [INFO] advance width (1) smaller than bitmap width (6)
    line: 1670
    suggestion: replace '{1, -3, -13}' with '{6, -3, -13}'

char94 - '~':
  [INFO] advance width (14) smaller than bitmap width (18)
    line: 1672
    suggestion: replace '{14, -1, -13}' with '{18, -1, -13}'

Should any of these characters be “corrected” in the master OS ?
I am guessing that some of those characters (with “weird” advances) were designed to work with some specific other characters.

It would be nice to know what was the intent of the author of those glyphs.

Yes.
Please remember to use small PRs whenever possible.

The advance is calculated from the original font. I think it’s working the way it’s supposed to.

Yes to which character(s)? I’ll probably slightly tweak most characters from StarJedi10Font.h one pixel here and there, at least for personal use. I am just getting started. The more I look at it the more improvements I find that can be done.

Do you want one PR per glyph ?

The “@” “STAR WARS” logo is 60 wide but the advance is only 52. I am pretty sure that is a “mistake” unless it was intended to be joined with other characters in a specific way.

Do you still have records of the original StarJedi10Font.h ?

The original is this: Star Jedi Font | dafont.com
Converted with: ProffieOS/fontconvert at master · profezzorn/ProffieOS · GitHub

Since the original conversion is completely automatic, it will sometimes end up with things that doesn’t look very good. However, I’m only interested in improvements that keeps the look of the original. Your changes to J is different from the original, and I don’t want that. Your changes to “2” and “3” seem like they are better version than the original, so that seems good.

I think the StarWars glyph is meant to line up with other things, but I don’t know what.

That seems like overkill.
Easiest thing might be just to have a discussion about which characters to include, and then put those in a PR. Based on what I see right now, that seems like all characters except jJ.

Pfew, I was worried you might say yes!

I’ll make all the improvement that I would like to see on my personal fonts. Once I’m done, I’ll post again the full tables for both Aurebesh & StarJedi and you can “cherry-pick” which you like best between original & “my version(s)”.

I understand about the “j” & “J” but that is a personal modification because I’m seeing “S” (due to a slight dyslexia), I will not PR those two.

For Aurebesh, I am trying to make the thickness and angle of diagonals more homogeneous. The way I see it, if a character looks good when “blown-up” x4, they usually look perfect at original size.