lets-plot-compose/src/desktopMain/kotlin/org/jetbrains/letsPlot/compose/canvas/SkiaFontManager.kt [11:39]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fun matchFamiliesStyle(fontFamily: List, fontStyle: FontStyle): Typeface { val fontConfig = fontFamily to fontStyle if (fontConfig in typefaceCache) { return typefaceCache.getValue(fontConfig) } var typeface = fontFamily.firstNotNullOfOrNull { FontMgr.default.matchFamilyStyle(it, fontStyle) } if (typeface == null || typeface.familyName == "") { typeface = fontFamily.firstNotNullOfOrNull { FontMgr.default.legacyMakeTypeface(it, fontStyle) } } if (typeface == null || typeface.familyName == "") { typeface = FontMgr.default.legacyMakeTypeface("sans-serif", fontStyle) } if (typeface == null || typeface.familyName == "") { println("Font not found: [${fontFamily.joinToString()}]") typeface = Typeface.makeEmpty() } typefaceCache[fontConfig] = typeface return typeface } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - platf-skia/src/commonMain/kotlin/org/jetbrains/letsPlot/skia/mapping/svg/FontManager.kt [14:42]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fun matchFamiliesStyle(fontFamily: List, fontStyle: FontStyle): Typeface { val fontConfig = fontFamily to fontStyle if (fontConfig in typefaceCache) { return typefaceCache.getValue(fontConfig) } var typeface = fontFamily.firstNotNullOfOrNull { FontMgr.default.matchFamilyStyle(it, fontStyle) } if (typeface == null || typeface.familyName == "") { typeface = fontFamily.firstNotNullOfOrNull { FontMgr.default.legacyMakeTypeface(it, fontStyle) } } if (typeface == null || typeface.familyName == "") { typeface = FontMgr.default.legacyMakeTypeface("sans-serif", fontStyle) } if (typeface == null || typeface.familyName == "") { println("Font not found: [${fontFamily.joinToString()}]") typeface = Typeface.makeEmpty() } typefaceCache[fontConfig] = typeface return typeface } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -