395 {
400
401 static constexpr FontDesc kMonoFonts[] = {
402 {
normal,
"LiberationMono-Regular.ttf"},
403 {bold, "LiberationMono-Bold.ttf"},
404 {
italic,
"LiberationMono-Italic.ttf"},
405 {bolditalic, "LiberationMono-BoldItalic.ttf"},
406 };
407
408 static constexpr FontDesc kSansFonts[] = {
409 {
normal,
"LiberationSans-Regular.ttf"},
410 {bold, "LiberationSans-Bold.ttf"},
411 {
italic,
"LiberationSans-Italic.ttf"},
412 {bolditalic, "LiberationSans-BoldItalic.ttf"},
413 };
414
415 static constexpr FontDesc kSerifFonts[] = {
416 {
normal,
"LiberationSerif-Regular.ttf"},
417 {bold, "LiberationSerif-Bold.ttf"},
418 {
italic,
"LiberationSerif-Italic.ttf"},
419 {bolditalic, "LiberationSerif-BoldItalic.ttf"},
420 };
421
422 static constexpr FontFamilyDesc kFamiliesData[] = {
423 {"monospace", "Liberation Mono", "LiberationMono", kMonoFonts},
424 {"sans-serif", "Liberation Sans", "LiberationSans", kSansFonts},
425 {"serif", "Liberation Serif", "LiberationSerif", kSerifFonts},
426 };
427
429
431#if defined(SK_FONTMGR_FONTCONFIG_AVAILABLE)
433#elif defined(SK_FONTMGR_CORETEXT_AVAILABLE)
435#elif defined(SK_FONTMGR_FREETYPE_EMPTY_AVAILABLE)
437#else
439#endif
440
441#if defined(SK_BUILD_FOR_UNIX)
442#define SK_FONT_FOLDER "/usr/share/fonts/truetype/liberation/"
443#elif defined(SK_BUILD_FOR_MAC)
444#define SK_FONT_FOLDER "/Library/Fonts/"
445#else
446#error "Unsupported OS"
447#endif
448
451 return 0;
452}
#define SkDEBUGFAIL(message)
SK_API sk_sp< SkFontMgr > SkFontMgr_New_Custom_Empty()
SK_API sk_sp< SkFontMgr > SkFontMgr_New_FontConfig(FcConfig *fc)
SK_API sk_sp< SkFontMgr > SkFontMgr_New_CoreText(CTFontCollectionRef)
static constexpr SkFontStyle Italic()
static constexpr SkFontStyle BoldItalic()
static constexpr SkFontStyle Bold()
static constexpr SkFontStyle Normal()
static void generate_index(const SkSpan< const FontFamilyDesc > &families, const FontDesc *defaultFont)
static void generate_fonts(const char *basepath, const SkSpan< const FontFamilyDesc > &families, sk_sp< const SkFontMgr > mgr)