Hi!
I have to know useable fonts
I add the local font path in FontRepository. but application can’t find the font. (Font Not Found Exception)
So, I want to see the font list in FontRepository.
How can I see it?
Here is my code.
(when tomcat started)
FontRepository.addLocalFontPath("/home/emro/font/");
(when PDF is generated)
…
stamp.getTextState().setFont(FontRepository.findFont(“gulim”, true)); => throw exception (but font folder has gulim ttc)
…
I use the aspose.word too.
that library provide the fonts list (that I can see)
FontSourceBase[] sources = FontSettings.getDefaultInstance().getFontsSources();
for(FontSourceBase base : sources){
List fontList = base.getAvailableFonts();
Iterator iter = fontList.iterator();
while(iter.hasNext()){
PhysicalFontInfo font = iter.next();
LOG.info(“fontFamilyName : {}”, font.getFontFamilyName());
LOG.info(“fullFontName : {}”, font.getFullFontName());
LOG.info(“Aspose.Word Font : {}”, font.getFilePath());
}
}
But I don’t know How can I see the font list in Aspose.PDF
I need your help.
I found that FontRepository is not global. is it right?
I print the fontPaths (FontRepository.getLocalFontPaths())
when tomcat started -> found the two paths (one is system font path, the other is custom font path)
when pdf is generated -> found one path (only system font path)
If then, whenever I make PDF, should I set the local font paths?? (FontRepository.addLocalFontPath("/home/emro/font/"))
oh! I solved it. I found the setThreadStaticConfigEnabled option.
T.T as expected, read api doc well.
I want to know how to get font list(include font name, font path …)… plz let me know that code… thanks.