ots icon indicating copy to clipboard operation
ots copied to clipboard

Support bitmap fonts (EBDT, EBLC)

Open o5k opened this issue 4 years ago • 11 comments

In deciding to not support bitmap fonts at all, OTS completely ignores many cultures and the ability to write crisp small print: Japanese print in Bitmap and vector Furthermore, it may be needed for designers to use crisp rendering for stylish purposes as well. As a major part of our web experience, OTS should look to support all languages and styles evenly!

o5k avatar Oct 08 '19 12:10 o5k

I won’t have time to work on this, but patches are welcome. Browsers can also ask OTS tp pass-though these tables and this wouldn’t need any changes to OTS, but someone will have to ask browsers to do it.

khaledhosny avatar Oct 08 '19 19:10 khaledhosny

I can patch this in, if it still needs doing.

mmulet avatar Mar 11 '21 23:03 mmulet

Contributions are always welcome.

khaledhosny avatar Mar 12 '21 04:03 khaledhosny

I made a Code Relay task for this https://github.com/code-relay-io/ots/blob/main/README.md . It will get done.

mmulet avatar Mar 19 '21 11:03 mmulet

In on this. Don't want to be stuck to Firefox forever.

ra-om avatar Mar 21 '21 19:03 ra-om

@ra-om We're on the ebdt branch right now. https://github.com/code-relay-io/ots/tree/ebdt You can jump right in.

mmulet avatar Mar 21 '21 19:03 mmulet

@mmulet I was wondering whether you found this issue the same way I found it. Then I looked back at where I found it and saw you created it. :P

flarn2006 avatar Apr 04 '21 20:04 flarn2006

@mmulet how's the work going? It would be great if OTS finally supported this =)

Pomax avatar May 13 '23 14:05 Pomax

Code Relay has been on pause for a year and half (although we've been been attempting to restart it since January). Agreed that this one should really get done, so I think I will have to do it myself. I looked at the problem a few years ago and I believe that with copilot/gpt-4 these days, it shouldn't take too long. Depending on how much free time I have, I think finishing during this summer would be realistic. (Side note: Are you the pomax of the bezier primer? If so, I just want to say that the primer is a goldmine of information and you have my heartfelt thanks for making it.)

mmulet avatar May 13 '23 15:05 mmulet

I am, always good to know it's been useful.

Pomax avatar May 14 '23 14:05 Pomax

Here is an update because it's been about 6 months and past my summer estimate.

This issue has been on my todo list, but life and work keep on getting in the way. This issue keeps on getting pushed back further and further on my list. At this rate, I estimate I will be finished by the end of January.

Sorry for the delay!

mmulet avatar Nov 02 '23 19:11 mmulet

I have the first draft of the EBDT, EBLC, and EBSC validators implemented.

If anyone has any fonts that use these tables, please share them here or send me an email. I'm looking for some real fonts that use these tables, so I can test the validators against them. So far, I've found that font forge will output ebdt/etc tables, and of course I can hand create some fonts or convert from bdf, but I would prefer to test against fonts in real use. It's been a little hard to find ebdt fonts because there is a lot of overlap with bdf/etc fonts when I search for "bitmap fonts".

mmulet avatar Jan 30 '24 01:01 mmulet

The Windows Korean Supplemental fonts have some EBDT fonts. batang.ttc and gulim.ttc both have TTFs inside with EBDT. So if you extract the TTC files, you will have eight TTF files with EBDT.

Some of the other CJK TTC files may also TTFs with EBDT, but you will have to check.

kenmcd avatar Jan 30 '24 02:01 kenmcd

Edit: Actually, this was a bug. The fact that Microsoft has a workaround for this font seems to be a strange coincidence.

~~On my validator, batang.ttc fails to validate because it uses variable metrics image formats in the EBDT while using constant metric index formats in the EBLC table~~ ~~Looking at the spec, it's unclear if this is allowed or disallowed.~~

~~I tried looking at other validators to see what they do, I found that Microsoft's font validator specifically ignores this issue just for batang.ttc~~

microsfot/Font-Validator/OTFFontFile/Table_EBDT.cs#L235:

// These images all have the same metrics as described in the indexSubTable so should have the proper image format
// Debug.Assert( nIndexFormat != 2 && nIndexFormat != 5 );
// commented out the above assert because batang.ttc violates this too much

~~So, if there are no objections here, I'm okay with allowing this (metrics in both EBLC and EBDT) in the validator.~~

mmulet avatar Jan 30 '24 18:01 mmulet

MS Mincho (msmincho.ttc) also has EBDT in the two TTF fonts. In the Windows Japanese Supplemental Fonts Pack.

Did not find any others with EBDT in the other CJK fonts.

kenmcd avatar Jan 31 '24 19:01 kenmcd

MS Mincho (msmincho.ttc) also has EBDT in the two TTF fonts. In the Windows Japanese Supplemental Fonts Pack.

Did not find any others with EBDT in the other CJK fonts.

mcmincho.ttc, uses a different bitmap format and a different embedded bitmap location format. So, that is a really good find.

I've created a list of all tested fonts and formats in the pull request: #273

mmulet avatar Jan 31 '24 20:01 mmulet

Found a few more with EBDT

Windows 11 standard fonts

  • lucon.ttf (Lucida Console)
  • msgothic.ttc
  • simsun.ttc
  • simsunb.ttf

Windows 95 standard font - MSSONG.TTF Thought this may now be in one of the newer TTC files, but did not find it.

kenmcd avatar Feb 01 '24 00:02 kenmcd