Comments (4)
Yet another reason to migrate away from EnumFontFamilies
to direct CreateFontIndirect
calls for each font request :-( I’ve been wanting to do that for quite a while, but it requires a (desirable) larger rewrite of our fontselect, so I haven’t found the energy to actually do it.
I think this happens because we call CreateFontIndirect
with the LOGFONT
returned by EnumFontFamilies
, which has only one font name—and it’s apparently the family name, seeing as EnumFontFamilies
returns a separate field for the full name. And the family name, of course, is the same for both of these fonts, as are all the other parameters contained within LOGFONT
, as you point out:
EnumFontFamiliesW:
family: [SF Pro Display] fullname: [SF Pro Display Bold] style: [Bold] charset: [0] weight: [700] ntmFlags: [0x40] FontType: [4] (TrueType)
family: [SF Pro Display] fullname: [SF Pro Display Bold Italic] style: [Bold Italic] charset: [0] weight: [700] ntmFlags: [0x40] FontType: [4] (TrueType)
So the value libass’s EnumFontFamilies
callback gives to CreateFontIndirect
is the same for both fonts, resulting naturally in the same font.
from libass.
A possible solution is to replace the
lfFaceName
with theelfFullName
of the ENUMLOGFONTEXW.
Oh. This sounds interesting. But this is only allowed for TrueType-outline fonts, not for CFF-outline ones. SF Pro Display is indeed a TrueType-outline font (although other affected Apple fonts may not be), but the problem is that our callback can’t know which kind of outlines the font has until it has actually obtained the font!
from libass.
A possible solution is to replace the
lfFaceName
with theelfFullName
of the ENUMLOGFONTEXW.Oh. This sounds interesting. But this is only allowed for TrueType-outline fonts, not for CFF-outline ones. SF Pro Display is indeed a TrueType-outline font (although other affected Apple fonts may not be), but the problem is that our callback can’t know which kind of outlines the font has until it has actually obtained the font!
Why do you say that? elfFullName
represent the postscript name for CFF-outline ones (yes this is a terrible name, but it is GDI...)
from libass.
Hang on, derp. CFF-outline fonts just return their PostScript name in the elfFullName
field. That’s what causes the difference in the first place. So yeah, we should be able to do that!
from libass.
Related Issues (20)
- Rendering: performance issue while rendering running rainbow animated subtitles HOT 4
- Rendering: Wrong font used for mpv OSD on Fedora 39+ HOT 2
- Multiple \pos tags in one line, any way to use them? HOT 2
- Inline fallback fonts should be sized to main font’s EM height, not line height
- How to blend ASS_Image to a rgba bitmap HOT 5
- Rendering: natural line break punctuation position in RTL languages HOT 2
- Consider adding SHSTK support HOT 4
- API to discard older events from memory HOT 2
- Rendering: Different case for a non-ASCII character doesn't find the font
- Rendering: Difference in font size with Roboto Medium in VSFilter and libass HOT 3
- checkasm struggles with PIC on (64-bit) Haiku HOT 13
- Separate muxed/memory fonts from system fonts
- build: Windows 10 + msys2 (with winiconv): passing argument 2 of 'iconv' from incompatible pointer type HOT 2
- warning: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argumentbuild: HOT 3
- Rendering: Incorrect font variant being selected HOT 13
- Overhaul fontselect: individual, cached, full-detail queries HOT 6
- Rendering: Start Delay Issue in libass Rendering Karaoke Subtitles HOT 10
- Discuss: -ffast-math and other math optimization flags HOT 8
- How to select Cascadia Mono font? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libass.