Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to support codepage 437? (e.g. PC graphics) #522

Open
erco77 opened this issue May 8, 2024 · 2 comments
Open

Is it possible to support codepage 437? (e.g. PC graphics) #522

erco77 opened this issue May 8, 2024 · 2 comments
Assignees
Labels
question General usage question

Comments

@erco77
Copy link

erco77 commented May 8, 2024

I maintain an MS-DOS based project whose manual occasionally uses PC graphics characters (cp-437) for things like tables, equipment wiring diagrams, schematics, and the like in lieu of images. The use is limited to the line/box drawing characters in the range 0xB0..0xDF.

I'm able to generate the 300 page manual just fine with scripts that convert the ASCII to html, but having trouble with the PC graphics in the htmldoc generated PDF.

I noticed htmldoc comes with several code page files, but not cp-437. Was wondering if I can make one myself by copying e.g. cp-1250, and then revising the byte code mappings for 0xB0 thru 0xDF as per the unicode equivalent 4 digit byte codes shown in this table (source):
image

So for instance, in the new cp-437 file:

[..cp-1250 content up to this point..]
B0 2591
B1 2592
B2 2493
B3 2502
B4 2524
[..similar mods thru DF, then back to the cp-1250 values past that..]

I'm hoping if that's right, then I can then use "---charset cp-437" to possibly get satisfactory results with a fixed width font like Courier.

Is that a good way to go about this? Or is there perhaps another way?
I don't know much about the cp-xxxx files yet, I'm just guessing at what they do, and hoping the fonts I'm mapping to would actually include those box drawing characters as part of their unicode support.

@michaelrsweet
Copy link
Owner

That is the way to do it. I don't think the included fonts contain these glyphs but that's how you would add the character set.

@michaelrsweet michaelrsweet self-assigned this May 8, 2024
@michaelrsweet michaelrsweet added the question General usage question label May 8, 2024
@erco77
Copy link
Author

erco77 commented May 8, 2024

Thanks mike, good to know I'm at least going in the right direction.

It seems it might be possible to convert a ttf font from here which contains all the glyphs for all ASCII + PC graphics chars, and convert it to the afm/pfa files that htmldoc uses with e.g. ttf2afm(1), which seems to come with my linux distro.

Doing that would probably result in having the entire PDF file rendered like a VGA screen, though.. which might be hilarious, but perhaps ugly in printed form.

The only other things I can think of are to find a ttf courier font that includes those extra unicode glyphs somehow, or try to splice them into an existing courier font.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question General usage question
Projects
None yet
Development

No branches or pull requests

2 participants