Commit Graph

28 Commits

Author SHA1 Message Date
Jeff Young 047b5f8b18 Cache for wxLocale::IsAvailable(). 2024-01-17 16:13:53 +00:00
Marek Roszko be21c689e8 Change the __except to use the exception result codes 2024-01-05 21:03:43 -05:00
Marek Roszko 05cbfc6aca Add Windows SEH to catch fontconfig/freetype font read faults
Related https://gitlab.com/kicad/code/kicad/-/issues/16484
2024-01-05 15:23:00 -05:00
Jeff Young 68cbb820a7 performance efficiencies 2023-12-18 17:20:34 +00:00
Jeff Young 1b6048b6d5 Handle non-binary font weights.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14502
2023-11-05 14:21:13 +00:00
jean-pierre charras 931401b5be Fix a compil issue (missing header) and a minor compil warning 2023-09-14 08:44:09 +02:00
Marek Roszko 5b9aab9070 fontconfig.cpp doesn't need pgm_base.h 2023-09-13 23:14:50 -04:00
Marek Roszko 11de95778b Unwrap the FROM_UTF8 macro in favor of direct function
The extern just gets annoying to try to export the func later. We also yeet TO_UTF8 to string_utils.h for parity.
2023-09-09 00:10:57 -04:00
Marek Roszko 53bf7b71c6 Don't call FcInitLoadConfigAndFonts after FcInit() already happened
We are only the default global FcConfig created by calling FcInitLoadConfigAndFonts inside FcInit().
Calling FcInitLoadConfigAndFonts does nothing but creating another FcConfig option that never gets disposed or used because we use the FcConfig functions with null
2023-08-26 13:53:43 -04:00
Jeff Young 7b3e01ce52 Select correct face from a .ttc file.
Fixes https://gitlab.com/kicad/code/kicad/issues/13314
2023-03-13 18:29:55 +00:00
Marek Roszko 39e69a3d29 Fix up handling of font names available in multiple names
ttf fonts can declare multiple language names. Many by default opt to just declare one and not tag it any particular language.
However, there are CJK languages that typically leverage this function the most. They'll tag both a "en" and a cjk lang family name in CJK characters.

To be as user friendly as possible, we need to display said fonts in the CJK languages if KiCad to set to such a locale.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14011
2023-02-21 20:26:41 -05:00
Seth Hillbrand bcc1e28bab Fix Windows build error
bc Microsoft owns all the words
2023-01-25 16:45:04 -08:00
Seth Hillbrand cf52bfcc55 Handle missing Bold/Ital outline fonts
If the font face doesn't include a Bold or Italic version, we still want
to display the font as bold/italic, so we fake it with freetype.

This also prevents recurring error messages where the outline font warns
about "substitutes" within the same font family.

Also allows variants on the weight descriptor to be used without
throwing a substitution warning

Fixes https://gitlab.com/kicad/code/kicad/issues/13654
2023-01-25 13:13:38 -08:00
Marek Roszko 0ff32d20cd wxS more things 2023-01-22 09:41:42 -05:00
Marek Roszko ac94995f70 Some more wxS 2023-01-16 19:07:50 -05:00
Ola Rinta-Koski 6196f2bdf0 Version info: report all font libraries 2022-03-07 14:01:37 +00:00
jean-pierre charras 2485648a54 Fix typo in a copy/paste and a minor compil warning 2022-02-07 17:32:19 +01:00
jean-pierre charras a37a7aa1d5 move a misplaced include 2022-02-07 08:22:43 +01:00
Marek Roszko 41f54349a5 Replace inserts/push_backs with emplace in some spots 2022-02-05 19:53:31 -05:00
Jeff Young a808e2396b Run font/laguage checks only on Mac. 2022-01-18 14:19:57 +00:00
Jeff Young d4ff829c26 Trace logging for fonts. 2022-01-18 14:08:47 +00:00
Jeff Young 7d032f9c2f Outline font rendering for Cairo, plotter, printer and 3D viewer.
Fixes https://gitlab.com/kicad/code/kicad/issues/10319
2022-01-10 01:54:28 +00:00
Jeff Young 78cac128b7 Careful: symbol fonts have no language.
Also a bit of clean up to shut up a false-positive in Coverity (and
clangd) on dereferencing a possibly (not) nullptr.
2022-01-09 11:34:20 +00:00
Jeff Young a170d3f006 Commenting. 2022-01-09 11:34:20 +00:00
Jeff Young a4349ae638 Cleanup and error reporting for fonts. 2022-01-09 11:34:20 +00:00
Jeff Young 6242b40cde Supported language filtering for fonts.
If the language isn't supported by the system, no point showing the
user the fonts.
2022-01-08 22:02:17 +00:00
Ola Rinta-Koski 5b7198dfc8 Fixes as per @sethhillbrand's comments 2022-01-08 16:47:45 +00:00
Ola Rinta-Koski 9b406c1da4 Outline font support. 2022-01-08 16:47:45 +00:00