kkartaltepe / obs-text-pango

Text Source using Pango for OBS Studio
GNU General Public License v2.0
49 stars 16 forks source link

"Select font from file" has no effect due to backwards FC_VERSION conditional #26

Closed codeman38 closed 1 year ago

codeman38 commented 1 year ago

The "select font from file" option in the configuration window is a complete no-op because of conflicting conditionals on what FC_VERSION is supported.

In line 278 of text-pango.c https://github.com/kkartaltepe/obs-text-pango/blob/8f4775d629624ea450474e39a4e7143166d8aeba/text-pango.c#L278 the "select font from file" option is hidden from the UI if FC_VERSION \< 21291. This is reasonable, as older fontconfig versions don't support the necessary API calls for this.

However, given that, the conditional in line 33 of text-utilities.h https://github.com/kkartaltepe/obs-text-pango/blob/8f4775d629624ea450474e39a4e7143166d8aeba/text-utilities.h#L33 is backwards! This code should only run if FC_VERSION >= 21291.

codeman38 commented 1 year ago

I can confirm that the change in the above-linked pull request fixes this for me; after recompiling with the change, the "select font from file" option actually uses the selected font file now, when it didn't before.