ststeiger / PdfSharpCore

Port of the PdfSharp library to .NET Core - largely removed GDI+ (only missing GetFontData - which can be replaced with freetype2)
Other
1.08k stars 237 forks source link

No Fonts installed on this device #309

Open maxwell60701 opened 1 year ago

maxwell60701 commented 1 year ago

how to drawstring font in chinese,thanks

maxwell60701 commented 1 year ago

it reports "No Fonts installed on this device!" in linux container,the ttf file can not be found if i copy it to "/usr/local/share/fonts" directory,if i copy it to "/usr/local/share/fonts/myfont" directory,it works. I saw the source codes,it only catch the ttf files under the subfolder in your path. foreach (string subDir in Directory.EnumerateDirectories(path, "*", SearchOption.AllDirectories)) fontList.AddRange(Directory.EnumerateFiles(subDir, "*", SearchOption.AllDirectories));

IndexGit commented 1 year ago

Looks like similar to this: https://github.com/ststeiger/PdfSharpCore/issues/125 Did you install fontconfig ? Maybe it has posibility to setup custom fonts?