VileRancour wrote:MestreLion wrote:About the encoding: to be usable in Unicode terminals (Mac OSX, Linux, BSD, etc), the CP347 glyphs need to mapped to their corresponding Unicode codepoint.
In that case you could just go with the 'true' Unicode variants I've been working on - here's a beta version of the CGA one. I thought this would be overkill as it has >700 glyphs for various scripts, but one of your github issues is support for UTF8 text input, so might as well kill two birds with one stone. 😉
CGA80normalUnicode_BETA_TrueType.zip
Yessss!! In this font the glyphs are in the "proper" codepoints, sweet! I didn't have the time (yet) to do a comprehensive check, but some of the key chars are in the expected codepoints, so great!. I've also noticed you've kept the sub-0x0020 codepoints with their CP437 glyphs (are they glyph aliases?), an interesting approach.
VileRancour wrote:One thing to keep in mind though. I had to deviate a little from the "canonical" CP437->Unicode mapping, for two reasons: (1) CP437 is ambiguous
Well, for practical purposes it's not. I mean, as Wikipedia says, one could argue if CP437 0xE1 is supposed to be a german "SS" or a greek "B"eta, but the solution is for the font to have both Unicode values share the same glyph... so you get the same CGA/VGA DOS glyph regardless if you asked for U+00DF or U+03B2. So when there's ambiguity, just include all possibilities. Also, there is a somewhat "official" CP437->Unicode 1:1 mapping, used by the Linux Kernel, projects like DosBox, VirtualBox, etc, that matches the table shown in Wikipedia.
VileRancour wrote:(2) I sourced the non-Latin characters from international CGA ROMs where possible, and some of them conflict with the original US CGA charset (CP437). For instance there's the full Greek alphabet from a Greek CGA card (courtesy of our fellow vogoner keropi), and the glyph for "τ" differs from the CP437 CGA "τ"... which happens to be the 'stick' in Rogue.
Of course, I wouldn't dare desecrate the One True Charset, so the original CP437 "τ" is still there 😁 I just mapped it to, uh, lemme check... 0x1D1B ("Latin Small Letter Capital T", it sez 'ere)
Lol, that requires some creativity! 😜 You'll have lots of trouble with this approach, as even ordinary letters such as "a" and "b" etc have different glyphs, and most importantly, different *baselines* when comparing the original CP437 with DOS codepage fonts such as 850, 852, etc. Sooner or later you might need to to create different font files, one where the original CP437 glyphs take precedence over the tweaked regional ones (even if each font include all glyphs)
VileRancour wrote:That's why I was hoping that the plain cp437 .ttf would "just work", but I guess you could either change the mapping in your code, or in the font itself using FontForge or similar. Anyway, looking at your list, I'm pretty sure that would be the only 'problematic' character.
I'm trying to avoid such "custom" mappings in code, as the game have no control over the font (or even *know* which font is being used!). So I'm sticking with 0x03C4 for the stick (no pun intended), as per the "official" mapping.
VileRancour wrote:For "Perfect DOS VGA CP437" I manually edited in FontForge most of the 255 glyphs to change their Unicode Value to the correct one, which in turn triggered an automatic update to their names and references, so the "happy face" is officially called "'smileface' WHITE SMILING FACE". But I'm a total dummy in FontForge, so not sure if there's an easier way to do this massive remapping.
You can actually load custom encodings in .txt or .ps formats and then use the Force Encoding option to do it in one fell swoop. If it wasn't for that, I'd probably have given up by now...
Nice!!!! Omg, it took me hours to do that manually! What a life-saver hint, thanks!
VileRancour wrote:Also, if you're willing to share this font with my humble project, don't forget to add a license TXT or something to the zipfile. I strongly recommend Creative Commons' CC-BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0/), as it's the most suitable for non-software intellectual work used in open source / free software projects.
Hm, I was gonna go with CC-BY-NC-SA 4.0 (which is what I put in the font's Names table), but it's not set in stone. I suppose the "NC" would conflict with GPL projects? Any reason to prefer 3.0 over 4.0?
Yes, NC conflicts not only with GPL but with any other free software license, such as the populars MIT, BSD, Apache, etc. An option if you really want to go the NC route is granting a CC-BY-SA (without the NC) license for individual projects (such as Rogue), while keeping the NC for everything else. But that's an approach usually frowned upon in the FOSS community, so I don't recommend it. I personally think BY (attribution) and SA (Share-Alike) are far more relevant for an author than NC.
As for 3.0 over 4.0, I was just not aware there was a 4.0 already 😀 After a quick research, it seem to be a nice and welcome upgrade