Commit Graph

7 Commits (ad85a9fa2501a5913538e80b43e9ea8e9d551af4)

Author SHA1 Message Date
Colin Edwards ad85a9fa25 Apply clang-format to objective c code 2019-07-09 13:39:13 -05:00
jp9000 e04ab3da7f text-freetype2: Make font lookup recursive on mac
On macs, some fonts can be in sub-folders of the font folder, and may
not properly be found.  This fixes that to detect directories and make
the lookup recursive.
2017-05-05 22:57:28 -07:00
jp9000 e91f5384b4 text-freetype2: Cache data to reduce load time
This caches the font list data to a file to minimize load times.  Font
data will be refreshed when any font files are added/removed, based upon
a checksum of the font file names and dates (if available).
2015-10-04 21:16:31 -07:00
jp9000 e33d567abe text-freetype2: Do not use fontconfig for mac
Originally, I tested the fontconfig code on mac and it was working
swimmingly.  However, it seems to be related to the fact that I am using
the ports/homebrew version of fontconfig.  Most users do not have that
version, and instead use the system built-in version of fontconfig,
which apparently does not find any mac fonts..  at all.  So, this
reverts the mac code to the older mac code we were using to manually
find and associate fonts with font files on the mac.
2014-08-26 12:43:33 -07:00
fryshorts 774731fbaf Use fontconfig for linux/mac
This uses fontconfig for looking up font files for freetype to use on
both linux and mac.  It's apparently a bit more optimal and prevents us
from having to worry about the load time on the mac version as well.

Refactored and moved all the old code to the find-font-windows.c file,
as it's no longer used on anything but windows.
2014-08-23 18:25:00 -07:00
Palana b0e119a475 Remove unused variable 2014-08-23 01:27:22 +02:00
jp9000 7f0ae838d7 Add system font lookup for mac/windows
This changes the font plugin from using a font file to using a specific
installed system font, which is searched for on each specific system and
associated with the font file.  It now uses a font property instead of a
path property, and font size has been removed because the font property
now handles that.

When the module is first loaded, it will build up a list of system fonts
in order to be usable by Freetype.  It was quite painful to program this
because font files can contain multiple localized versions of their face
names, and then there was the issue where windows likes to mangle
custom style types to the font name.  Regardless, it all seems to have
worked out pretty well.

Minor issues:
- Truetype/Opentype fonts sometimes do not automatically have
  italic and/or bold styles available, it seems that the system applies
  transformations manually in those cases.  We don't do this yet,
  however, so right now a user might select a font with italic/bold
  only to discover that italic/bold doesn't always work.  Not entirely
  sure what to do about this yet.  There's probably a freetype function
  to do something like that somehow,

This also requires that iconv be used for non-windows systems to be able
to look up localized font names within font files.  Windows will use
the win32 API and code page IDs to translate font names.
2014-08-19 02:11:37 -07:00