Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Use custom font and also make that font available for other applications

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I would like to use custom font (TTF), which I can do using Font.createFont(), but I would like other applications to be able to use that font which means I would like to install in my OS(my OS- windows 7) fonts directory. I tried to register to GraphicsEnvironment but other applications are not able to use that font.

Thanks in advance. please help.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know this can't be done in Java, short of calling Runtime#exec(...) or ProcessBuilder#start() to launch a native application that can do it.
 
Abhi Ahuja
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for your reply Darryl, please let me know if anybody has any work around or anything...thank
 
Sheriff
Posts: 21971
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the application can only use the installed fonts then there is no workaround.
 
Darryl Burke
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a big question here: if you want the font installed on your system, why do you want that to be done by a Java program?
 
Abhi Ahuja
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Darryl,

What I am trying to do is that use a custom font(not available in windows), which I am able to do using CreateFont() and I am using that font in my application. Now when I try to print the text using a Virtual PDF printer(PDFCreator), PDFCreator is printing as Shapes hence the text in the PDF is not selectable.

So just to test I tried to use a font(instead of a custom) which is available in windows font directory, and when I print the content now, the pdf text is selectable, i.e. the content is printed as text and not Shapes. I guess, because the font is not available in windows, PDFCreator is not able to use it.

So in order to deal with this problem, I think only way to achieve is to install in windows and then use the font.

Thanks.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic