This Time Self-Hosted
dark mode light mode Search

xine’s fontconfig

So, today I decided to change my priorities lists to do the fontconfig support before trying to mess with xbindkeys/xvkbd. Why? Because xbindkeys’s code scared me, as it uses low-level libX11 and I’m pretty bad with it.

Unfortunately fontconfig’s documentation is just a mere reference, a bit ambiguous sometimes, too, so to actually be able to get something working I had to look at fc-match and pango sources.

At the end I refactored the whole loading function for xine-lib’s osd, breaking it up in two functions, one generic loading function, and a FreeType2 loading function. This way I don’t have to use nested and sub-nested if conditionals, and I can just load the font from different places till it hits.

I also changed the priority of FreeType2 over bitmap fonts, because by default it would have just hit bitmap fonts and be done with that, without even bothering with FreeType2, making the whole FontConfig support mostly useless.

Unfortunately, FreeType2 rendering it’s pretty ugly right now:

xine with freetype osd and subtitles

I’m not really sure what the cause is, but I’ll try to debug this until I find the cause and get a decent rendering. The pretty cool thing is that you can just write “Mikachan” after installing media-fonts/mikachan and have it used without further configuration 🙂

And fontconfig support is needed if I’m going to implement ASS subtitles support, as they can specify which font family to use.

Oh, and yes, I’m trying to bump ALSA, but their usual method is applied: they announced the release but didn’t actually upload the tarballs on the mirrors :/

Comments 3
  1. Seems to me that antialiassing is playing tricks. Remember that as far as freetype/Xft are concerned, the video doesn’t exist when using Xv(ideo). In short you’ll have to fix this by choosing a good background colour and reducing the transparency (only 0 and 100% are good for video)

  2. It’s mikachan-font :-). Funny that you mention it, are you even still able to use mikachan-font anymore? Seeing as it doesn’t provide TTF files anymore…Check out my sordid saga with mikachan-font over in this entry of my own.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.