font embed try #2

This commit is contained in:
2025-11-15 22:25:14 +01:00
parent 99e3956fab
commit 577b477f4d
77 changed files with 94 additions and 77 deletions
+15
View File
@@ -68,13 +68,21 @@ import sys.FileSystem;
}
#if (openfl && !flash && !display)
openfl.text.Font.registerFont (__ASSET__OPENFL__assets_fonts_montserrat_montserrat_semibold_600_ttf);
#end
var data, manifest, library, bundle;
data = '{"name":null,"assets":"aoy4:sizei260936y4:typey4:FONTy9:classNamey60:__ASSET__assets_fonts_montserrat_montserrat_semibold_600_ttfy2:idy27:Montserrat_SemiBold_600.ttfgh","rootPath":null,"version":2,"libraryArgs":[],"libraryType":null}';
manifest = AssetManifest.parse (data, rootPath);
library = AssetLibrary.fromManifest (manifest);
Assets.registerLibrary ("default", library);
library = Assets.getLibrary ("default");
if (library != null) preloadLibraries.push (library);
else preloadLibraryNames.push ("default");
}
@@ -85,15 +93,20 @@ import sys.FileSystem;
#if !display
#if flash
@:keep @:bind @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserrat_semibold_600_ttf extends null { }
@:keep @:bind @:noCompletion #if display private #end class __ASSET__manifest_default_json extends null { }
#elseif (desktop || cpp)
@:keep @:file("bin/neko/obj/tmp/manifest/default.json") @:noCompletion #if display private #end class __ASSET__manifest_default_json extends haxe.io.Bytes {}
@:keep @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserrat_semibold_600_ttf extends lime.text.Font { public function new () { __fontPath = ManifestResources.rootPath + "assets/fonts/Montserrat/Montserrat_SemiBold_600.ttf"; name = "Montserrat SemiBold"; super (); }}
#else
@:keep @:expose('__ASSET__assets_fonts_montserrat_montserrat_semibold_600_ttf') @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserrat_semibold_600_ttf extends lime.text.Font { public function new () { #if !html5 __fontPath = "assets/fonts/Montserrat/Montserrat_SemiBold_600.ttf"; #else ascender = null; descender = null; height = null; numGlyphs = null; underlinePosition = null; underlineThickness = null; unitsPerEM = null; #end name = "Montserrat SemiBold"; super (); }}
#end
@@ -101,8 +114,10 @@ import sys.FileSystem;
#if (openfl && !flash)
#if html5
@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserrat_semibold_600_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserrat_semibold_600_ttf extends openfl.text.Font { public function new () { name = "Montserrat SemiBold"; super (); }}
#else
@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserrat_semibold_600_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserrat_semibold_600_ttf extends openfl.text.Font { public function new () { __fontPath = ManifestResources.rootPath + "assets/fonts/Montserrat/Montserrat_SemiBold_600.ttf"; name = "Montserrat SemiBold"; super (); }}
#end