1

I'm trying to implement a C/C++ program that given a string and a font configuration return the best font set to render the string.

The string might need more the one font to be rendered correctly. How FontConfig handle this situation? Is it smart enough to tell me which character should be render by which font?

Note: I'm a Java developer so I'm not that strong with C++, so maybe my question have a trivial answer.

Simone Rondelli
  • 318
  • 1
  • 11
  • No, it's not a trivial question, and really, for someone new to C++, dealing with fontconfig should not be the first choice. – Sam Varshavchik Nov 22 '16 at 18:05
  • Hi Sam, we already have a Java solution that does the job but it's really vertical for our use case so we are looking around for alternative solutions. I just need to create a PoC that shows the fontconfig capabilities to evaluate if it is a viable alternative. – Simone Rondelli Nov 22 '16 at 18:14
  • Sam do you have any suggestion (rather than not to use it)? – Simone Rondelli Nov 23 '16 at 13:32
  • No, fontconfig is a very solid, very useful library. I used it myself. The issue is that this is not something I would recommend for "someone new to C++" to work with. Basically, fontconfig works by taking the list of requirements, and then sorting all fonts that meet those requirements, arranging them according to its own metric of which one is "better", if multiple fonts match those requirements. One of those requirements is which glyphs are defined in the font. You would use that to find fonts that can render the string, and then further constrain by font size, name, etc... – Sam Varshavchik Nov 23 '16 at 13:35
  • ... however, this is not exactly a "make it so" with one or two function calls. Fontconfig's API is not trivial, and it will take some time to study it, and figure out how to use it. – Sam Varshavchik Nov 23 '16 at 13:35

0 Answers0