File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to manipulate fonts?

 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i give a specific font face,size,color in JavaScript?
document.fgColor = "blue"; means foreground color of all fonts but i want some particular fonts to manipulate as we did in HTML thru "<font face color size>Some</font>"....anyone help...
------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!
 
David Kane
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a pretty good example of this at:
http://www.mozilla.org/docs/dom/samples/dom-css-fonts/colorfades.html
There are two keys to this code, that address your concern. First, use a DIV with ID attribute around the text you want to alter.
Second, the following line, gets this object and alters its CSS properties. The following line from the page above illustrates this.
document.getElementById("text"+el).style.color="rgb("+aa+","+aa+","+aa+")";
Good luck!
David
------------------
David Kane
david_kane@houseofyin.com
Author of Software Architecture: Organizational Principles and Patterns
http://www.vraps.com
http://www.houseofyin.com
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic