IMHO, it may not be easy. Browsers display HTML using the fonts installed on the user's system. Also, browsers usually allow the users to override the document settings and choose their own font preferences.
- Microsoft provides a web embedding font tool (WEFT): http://www.microsoft.com/typography/web/embedding/. But this is non-standard and will not work on other browsers.
- You can use programs like Flash. Programs like Flash are plugins/addons to the browser and perform their own rendering.
- You can provide the pages which needs to be in a specific font as an image in your application. (Run the page on a machine which has the fonts installed and capture the image). Including the pages as images is in a way taking over the rendering of HTML from the browser...
If HTML needs to be displayed in a custom font, the application can provide links to the font file and provide (platform-specific) instructions on manually installing the font and setting the browser preferences correctly. The browser will also need to be likely closed and restarted for the changes to take effect...
Hi,
I got this info : http://java.sun.com/j2se/1.3/docs/guide/intl/addingfonts.html
I was assuming if my application used beer.ttf as a font and that this was not a standard windows IE available font then I could put it into my webapplications jre/lib/fonts as suggested and this would work, however it does not. I retstart Tomcat after uploading the file but the font isnt found by the webapp. I think Iam also missing somthing here.
Could someone explain where the webapp looks for fonts ?
Regards
Jim
createFont() can be used from a standalone java application. It can also be used in a web application but then the code would execute on the server. Eventually a web app merely serves the HTML files to the client and it is the browser that renders the page.
On the client, browser, one possible way would be to use applets. (Or plugins or addons to browsers which perform their own rendering).
HTML documents can request a specific font but the browser will try to satisy the request with the closest matching font available on the user's system.
Ref:
http://www.netmechanic.com/news/vol3/css_no15.htm
http://www.webmonkey.com/webmonkey/99/45/index0a.html