Font file requirements?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Justin Z
    Rookie
    • Nov 2014
    • 20

    Font file requirements?

    I wish to use DOS-like fonts with Angband (4.0.5) but almost none of the .FON files I have found are agreeable to the game. It interprets them in the same consistent, nonsensical way, reverting to one of the default fonts included with the game while displaying that font's characters incorrectly and at bizarre widths and heights that I can't change.

    Screenshot is attached.

    I had an old DOSLike font from way back when that works out of the box and looks nice, but when I added a few glyphs to it using FontForge (it lacks the control code characters and many of them are graphically useful for Angband) it reverted to the behaviour you see in the screenshot.

    Thanks for any information.
    Attached Files
  • Justin Z
    Rookie
    • Nov 2014
    • 20

    #2
    Comparison screenshot for informational purposes, this is with the original font, which is also attached in a zip.
    Attached Files

    Comment

    • Nick
      Vanilla maintainer
      • Apr 2007
      • 9638

      #3
      This is quite complex.

      This thread has some tips, but probably requires Softy, an old font editor that stopped working at Windows 7. Still, the dpi comments might help. Other threads on the matter include this one and this one - as you can see, this and similar problems have a long history.

      Good luck!
      One for the Dark Lord on his dark throne
      In the Land of Mordor where the Shadows lie.

      Comment

      • Justin Z
        Rookie
        • Nov 2014
        • 20

        #4
        Thanks for that--I've looked into a few things based on this info. I can't even load the font from the file into any of various font editors, save it without making any changes, and use it in Angband. It'll still be weird about something in the file, causing it to not handle the font properly and its fallback is to just ignore display of the font and revert to default.

        The DOSLike font I got to work was created in 1998, so the issue is probably something that got added to the Windows .FON standard between then and now that the Angband source code has never been updated to deal with. But what in the world it is, I have no idea.

        Comment

        • Justin Z
          Rookie
          • Nov 2014
          • 20

          #5
          The other weird thing by the way is that I managed to accomplish this with an older build, I want to say 3.5.3, but it's been a while. Either way, suddenly it just doesn't work anymore when you import the rewritten font with the glyphs you want.

          Comment

          • t4nk
            Swordsman
            • May 2016
            • 336

            #6
            There is no .fon format standard, you probably got a completely different .fon (not the one that "Softy" used to produce).
            I'm thinking about making a bitmap font editor, but I'm completely unable to find any information about .fon internal structure. Someone knows where I can find it? Or the only solution is to analyse

            Also, what do you call "control code characters".

            Comment

            • Justin Z
              Rookie
              • Nov 2014
              • 20

              #7
              Referring to x00 through x1F, characters like ☺, ♣, ♀, etc.

              Comment

              • Pete Mack
                Prophet
                • Apr 2007
                • 6883

                #8
                What's a real nuisance is there's no standard interface to TrueType for gnu C or WIN32; the only windows interface is .NET.
                If there were, all you'd need is a Unicode mapping function to the glyphs of your choice, rather than all the .FON nonsense.

                Comment

                • Justin Z
                  Rookie
                  • Nov 2014
                  • 20

                  #9
                  Well, now I'm completely stumped, as I went to the trouble of creating a new font file from DosLike using Softy in a Windows XP virtual machine . . . 4.0.5 STILL doesn't like it. I wonder what the hell I'm doing to break the font. Then again, seeing as zero of the bitmap fonts I tried from here worked, it's probably not much.
                  Last edited by Justin Z; February 28, 2017, 21:13.

                  Comment

                  • Nick
                    Vanilla maintainer
                    • Apr 2007
                    • 9638

                    #10
                    Originally posted by Justin Z
                    Well, now I'm completely stumped, as I went to the trouble of creating a new font file from DosLike using Softy in a Windows XP virtual machine . . . 4.0.5 STILL doesn't like it. I wonder what the hell I'm doing to break the font.
                    Ideas:
                    • Did you change the dpi?
                    • Did you try running 4.0.5 with the new font in the XP VM?
                    • It may be that Windows 10 has introduced some other incompatibility
                    • FAangband (current version or 1.1.6) might do some things differently, if you're experimenting it might be worth looking at how well they work
                    • I really don't think I changed anything to do with fonts going from 3.5 to 4.0


                    I have spent quite a bit of time struggling with Windows fonts over the years, and sometimes just had to give up and hope someone else fixed it. Not to discourage you
                    One for the Dark Lord on his dark throne
                    In the Land of Mordor where the Shadows lie.

                    Comment

                    • Justin Z
                      Rookie
                      • Nov 2014
                      • 20

                      #11
                      Originally posted by Nick
                      Ideas:
                      • Did you change the dpi?
                      • Did you try running 4.0.5 with the new font in the XP VM?
                      • It may be that Windows 10 has introduced some other incompatibility
                      • FAangband (current version or 1.1.6) might do some things differently, if you're experimenting it might be worth looking at how well they work
                      • I really don't think I changed anything to do with fonts going from 3.5 to 4.0


                      I have spent quite a bit of time struggling with Windows fonts over the years, and sometimes just had to give up and hope someone else fixed it. Not to discourage you
                      Thanks for the ideas. I tried to even do just a load it up, save it up--and that still didn't work. Something's going on for sure. Good idea testing in the Virtual Machine though, I'm going to do that now.

                      What puzzles me most of all is that I have one solitary file that works--the DOSLike.fon I attached earlier in the thread. What sets it (and Angband's built-in fonts) apart? It is a mystery. Anyway I'll see what happens in XP, then check FAangband.

                      Edit: Exact same behaviour even in Windows freakin' XP. I thought you were onto something. Checking FAangband now . . .

                      Edit2: Annnd exactly the same result there as well.

                      Edit3: Also, for the record, this is happening now on the old builds too. So who knows what in the world the difference was back when I got other fonts to work.
                      Last edited by Justin Z; February 28, 2017, 21:42.

                      Comment

                      • t4nk
                        Swordsman
                        • May 2016
                        • 336

                        #12
                        So how about describing what you're doing exactly... You mentioned symbols ☺, ♣, ♀, those are not in the range 0 - 31. How are you adding them, etc. Looking at main-win.c, one place where it can fail is line 1391 (AddFontResourceEx(...)). I don't see "#define UNICODE" anywhere (so I take it it's compiled as something that Windows people call "ANSI"), so, yeah, how are you adding those symbols?

                        Comment

                        • Justin Z
                          Rookie
                          • Nov 2014
                          • 20

                          #13
                          I tried various methods in Windows 10--one was to insert the glyphs into their traditional positions, effectively enlarging the total set. I tried various encodings, including Windows Latin and several ISO 8859 sets. Another idea was to replace some of the glyphs that are just boxes with those symbols, keeping the font the same size from a total number of glyphs standpoint (and presumably maintaining compatibility--but not in actuality).

                          And then as I mentioned, both with the newer software and with Softy on the virtual machine, I simply loaded the font, saved it, tried it in Angband. . . and something still broke in-between.

                          To clarify, those symbols are in the range 0-31 in code page 437, which is what DOS used. I know things work differently in Windows, but if I could wave a magic wand I'd get a font that mirrors what you'd get in DOS from 0-255, with things like δ at position 235 (looks like a snake) and ¢ at 155 (looks like a helmet with a face shield), and so on.
                          Last edited by Justin Z; March 1, 2017, 12:21.

                          Comment

                          • Pete Mack
                            Prophet
                            • Apr 2007
                            • 6883

                            #14
                            The Russian guy who posts videos made a mini documentary on angband (actually ToME) fonts. He created his own, from scratch.

                            Comment

                            • Justin Z
                              Rookie
                              • Nov 2014
                              • 20

                              #15
                              Originally posted by Pete Mack
                              The Russian guy who posts videos made a mini documentary on angband (actually ToME) fonts. He created his own, from scratch.
                              I saw that video and got excited because he was using different software. Tried it--same result as everything else.

                              Comment

                              Working...
                              😀
                              😂
                              🥰
                              😘
                              🤢
                              😎
                              😞
                              😡
                              👍
                              👎