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

[DirectWrite] libass doesn't always find a fallback font #791

Open
moi15moi opened this issue Jun 19, 2024 · 2 comments
Open

[DirectWrite] libass doesn't always find a fallback font #791

moi15moi opened this issue Jun 19, 2024 · 2 comments

Comments

@moi15moi
Copy link
Contributor

moi15moi commented Jun 19, 2024

In some case, DirectWrite doesn't find a fallback font, but there is actually some.

For example, I tried to display U+ABC4 with Arial, but libass display a Tofu box.
But, actually, if I specify the font Nirmala Ui, now it display it.
Note that VSFilter has the same problem (which means TextOutW has the same problem).
There is probably not any good solution. I guess we need to iterate on all the font in the IDWriteFontCollection and see if it has the glyph.

libass version: 0.17.1
windows version: 10.0.19045.4529

Ass Sample

[Script Info]
; Script generated by Aegisub 9746-feature-aa68c2e66
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: None
PlayResX: 1920
PlayResY: 1080

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial,20,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,2,2,2,10,10,10,1

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.00,0:00:05.00,Default,,0,0,0,,ꯄ
@rcombs
Copy link
Member

rcombs commented Jun 19, 2024

I'm not too worried since the Meitei script has been extremely rare for centuries, and only very recently started to become used again. I'd imagine this is a bug in DirectWrite's fallback code (perhaps it doesn't know that U+ABC0 through U+ABFF maps to the Mtei script ID?), and it probably affects other software as well; I'd recommend reporting this to Microsoft.

We could theoretically add a last-resort iteration over the full list, but let's at least try to bug MS about it first.

@moi15moi
Copy link
Contributor Author

I tested with IDWriteFontFallback::MapCharacters and it also return no font, so it isn't the IDWriteTextLayout "technique" that doesn't always work.

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

No branches or pull requests

2 participants