Fix load order in FallbackFontDatabase.
This commit is contained in:
parent
88e060a92b
commit
f8a4c73367
@ -41,6 +41,8 @@ namespace Quik.Media.Defaults.Fallback
|
|||||||
VerifyDatabase(database);
|
VerifyDatabase(database);
|
||||||
FlushDatabase(database);
|
FlushDatabase(database);
|
||||||
|
|
||||||
|
database.ForEach(x => AddFont(x.Face, new FileInfo(x.FilePath)));
|
||||||
|
|
||||||
(FontFace, FileInfo) serif = FontDataBaseProvider.ResolveSystemFont(EnvironmentVariables.SerifFont, LinuxFonts.DefaultSerifFamilies, this);
|
(FontFace, FileInfo) serif = FontDataBaseProvider.ResolveSystemFont(EnvironmentVariables.SerifFont, LinuxFonts.DefaultSerifFamilies, this);
|
||||||
SystemFonts[SystemFontFamily.Serif] = serif.Item1;
|
SystemFonts[SystemFontFamily.Serif] = serif.Item1;
|
||||||
(FontFace, FileInfo) sans = FontDataBaseProvider.ResolveSystemFont(EnvironmentVariables.SansFont, LinuxFonts.DefaultSansFamilies, this);
|
(FontFace, FileInfo) sans = FontDataBaseProvider.ResolveSystemFont(EnvironmentVariables.SansFont, LinuxFonts.DefaultSansFamilies, this);
|
||||||
@ -51,14 +53,6 @@ namespace Quik.Media.Defaults.Fallback
|
|||||||
SystemFonts[SystemFontFamily.Cursive] = cursive.Item1;
|
SystemFonts[SystemFontFamily.Cursive] = cursive.Item1;
|
||||||
(FontFace, FileInfo) fantasy = FontDataBaseProvider.ResolveSystemFont(EnvironmentVariables.FantasyFont, LinuxFonts.DefaultFantasyFamilies, this);
|
(FontFace, FileInfo) fantasy = FontDataBaseProvider.ResolveSystemFont(EnvironmentVariables.FantasyFont, LinuxFonts.DefaultFantasyFamilies, this);
|
||||||
SystemFonts[SystemFontFamily.Fantasy] = fantasy.Item1;
|
SystemFonts[SystemFontFamily.Fantasy] = fantasy.Item1;
|
||||||
|
|
||||||
AddFont(serif.Item1, serif.Item2);
|
|
||||||
AddFont(sans.Item1, sans.Item2);
|
|
||||||
AddFont(mono.Item1, mono.Item2);
|
|
||||||
AddFont(cursive.Item1, cursive.Item2);
|
|
||||||
AddFont(fantasy.Item1, fantasy.Item2);
|
|
||||||
|
|
||||||
database.ForEach(x => AddFont(x.Face, new FileInfo(x.FilePath)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileInfo FontFileInfo(FontFace face)
|
public FileInfo FontFileInfo(FontFace face)
|
||||||
@ -241,7 +235,7 @@ namespace Quik.Media.Defaults.Fallback
|
|||||||
{
|
{
|
||||||
FileInfo info = new FileInfo(DbPath);
|
FileInfo info = new FileInfo(DbPath);
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(DbPath));
|
Directory.CreateDirectory(Path.GetDirectoryName(DbPath));
|
||||||
using Stream str = info.OpenWrite();
|
using Stream str = info.Open(FileMode.Create);
|
||||||
JsonSerializer.Serialize(str, db);
|
JsonSerializer.Serialize(str, db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user