For layouting the elements, CSSBox uses the Java serif font. However, I want it to use a physical font such as "Times New Roman". How can I achieve this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, ok. I read your API and found the corresponding getter method. With java.awt.Font.decode you can receive the physical font indicated by the return value of getDefaultFont(). Thanks.
Last edit: Nogge 2013-04-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was wondering Are you able to setDefaultFont(Str,Str) for BrowserConfig object? I tried but no effect on the generated svg .
I tried with latest code from repository too(error using it). I would appreciate if you can suggest something to achieve functionality to add fonts that are available in your system(win / linux).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For layouting the elements, CSSBox uses the Java serif font. However, I want it to use a physical font such as "Times New Roman". How can I achieve this?
Hi,
you may use the
canvas.getConfig().setDefaultFont()
configuration function.However, this functionality is only available in the SVN trunk version. It will be available in the next CSSBox release (hopefuly in May). See the ImageRendered demo in trunk for an example (the setDefaultFonts() function)
https://sourceforge.net/p/cssbox/code/HEAD/tree/trunk/src/org/fit/cssbox/demo/ImageRenderer.java
Interesting. But how can I get the font "Times New Roman" instance for a specific element after executing cssbox? It still returns the "Serif" font.
Ok, ok. I read your API and found the corresponding getter method. With java.awt.Font.decode you can receive the physical font indicated by the return value of getDefaultFont(). Thanks.
Last edit: Nogge 2013-04-29
I was wondering Are you able to setDefaultFont(Str,Str) for BrowserConfig object? I tried but no effect on the generated svg .
I tried with latest code from repository too(error using it). I would appreciate if you can suggest something to achieve functionality to add fonts that are available in your system(win / linux).