Java Doc for LinuxNativeFont.java in  » Apache-Harmony-Java-SE » org-package » org » apache » harmony » awt » gl » font » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » org package » org.apache.harmony.awt.gl.font 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.harmony.awt.gl.font.LinuxNativeFont

LinuxNativeFont
public class LinuxNativeFont (Code)
Library wrapper of native linux font functions.


Field Summary
final public static  intFC_SLANT_ITALIC
    
final public static  intFC_SLANT_OBLIQUE
    
final public static  intFC_SLANT_ROMAN
    
final public static  intFC_WEIGHT_MEDIUM
    
public static  String[]faces
     List of font faces names of system fonts supported by a system.
public static  intfacesCount
     The number of different fonts installed onto the system.
public static  int[]famIndices
     List of family indexes in families array corresponding to the faces indexing.
public static  Vectorfams
     Set of all unique families installed onto the system.
public static  int[]fontStyles
     List of font styles of system fonts supported by a system corresponding to faces indexing.
public static  String[]styleNames
     List of font style names of system fonts supported by a system corresponding to faces indexing.


Method Summary
native public static synchronized  voidNativeFreeGlyphBitmap(long bitmap)
     Disposes memory block that is used by FreeType FT_Bitmap structure by pointer specified.
native public static synchronized  longNativeInitGlyphBitmap(long fnt, char chr)
     Returns pointer to GlyphBitmap structure that represents bitmap with parameters of the character specified or 0 if failures in native code.
native public static synchronized  intRemoveFontResource(String tempFontFileName)
     Updates specified folder where temporary font created from InputStream stored. This method used in LinuxFont dispose method, it re-caches ~/.fonts directory, after temporary font file is deleted.
Parameters:
  tempFontFileName - directory that is being re-cached name.
native public static  booleanXftDrawSetClipRectangles(long xftDraw, int xOrigin, int yOrigin, long rects, int n)
     Sets clipping rectangles in Xft drawable to the specified clipping rectangles.
native public static synchronized  booleancanDisplayCharNative(long hndFont, char c)
     Returns true, if XftFont object can display specified char.
native public static synchronized  longcreateXftDrawNative(long display, long drawable, long visual)
     Returns XftDraw handle created from specified parameters using Xft library.
native public static synchronized  voiddrawStringNative(long xftDraw, long display, long colormap, long font, int x, int y, char[] chars, int len, long xcolor)
     Draws text on XftDraw with specified parameters using Xft library.
public static  FontembedFont(String absolutePath)
     Adds new plain font with 1 pt.
native public static synchronized  StringembedFontNative(String absolutePath)
     Returns true if the new font was added to the system, false otherwise.
native public static synchronized  voidfreeGlyphOutline(long ptr)
     Disposes memory block that is used by FreeType FT_Outline structure by pointer specified.
native public static synchronized  voidfreeXftDrawNative(long xftDraw)
     Destroys XftDraw object.
public static  Font[]getAllFonts()
     Returns an array of instances of 1 pt.
native public static  longgetAntialiasedFont(long font, long display, boolean isAntialiasing)
    
native public static synchronized  float[]getExtraMetricsNative(long hFont, int fontSize, int fontType)
     Returns an array of extrametrics of the font:

elem[0] - the average width of characters in the font (Type1 - 0.0f)

elem[1] - horizontal size for subscripts (Type1 - 0.7f * fontHeight)

elem[2] - vertical size for subscripts (Type1 - 0.65f * fontHeight)

elem[3] - horizontal offset for subscripts (Type1 - 0.0f)

elem[4] - vertical offset value for subscripts(Type1 - 0.15f * fontHeight)

elem[5] - horizontal size for superscripts (Type1 - 0.7f * fontHeight)

elem[6] - vertical size for superscripts (Type1 - 0.65f * fontHeight)

elem[7] - horizontal offset for superscripts (Type1 - 0.0f)

elem[8] - vertical offset for superscripts (Type1 - 0.45f * fontHeight)

For TrueType fonts metrics are taken from OS2 table, for Type1 fonts metrics are calculated using coefficients (read FontExtraMetrics comments).

public static  String[]getFaces()
     Returns array of Strings that represent face names of all fonts supported by a system.
public static  String[]getFamilies()
     Returns the list of system font families names.
public static  StringgetFamilyFromFaceIndex(int faceIndex)
     Returns family name that corresponds to the face with specified face index.
native public static synchronized  StringgetFamilyNative(long hndFont)
     Returns family name of the XftFont object.
native public static synchronized  String[]getFontFamiliesNames()
     Returns array of Strings that represents list of all font families names available on the system.
native public static synchronized  StringgetFontNameNative(long hndFont)
     Returns face name of the XftFont object.
native public static synchronized  StringgetFontPSNameNative(long fnt)
     Returns XftFont's postscript name. Returned value is the name of the font in system default locale or for english langid if there is no results for default locale settings.
public static  intgetFontStyle(int faceIndex)
     Returns font style of the font with face having specified index.
public static  StringgetFontStyleName(int faceIndex)
     Returns font style name of the font with face having specified index.
native public static synchronized  String[]getFonts()
     Returns an array of available system fonts names.
native public static synchronized  intgetGlyphCodeNative(long fnt, char uChar, long display)
     Returns glyph code corresponding to the specified character, null is returned if failure.
native public static synchronized  int[]getGlyphCodesNative(long fnt, String str, int len)
     Returns glyphs code corresponding to the characters in String specified, null is returned if failure.
native public static synchronized  float[]getGlyphInfoNative(long pFnt, char c, int fontSize)
     Returns array of glyph metrics values for the specified character null is returned and NullPointerException is thrown in case of FreeType errors.
native public static synchronized  longgetGlyphOutline(long pFont, char c)
     Returns pointer to the FreeType FT_Outline structure.
native public static synchronized  int[]getGlyphPxlInfoNative(long display, long pFnt, char c)
     Returns array of glyph metrics values in pixels for the specified character null is returned and NullPointerException is thrown in case of FreeType errors.
native public static synchronized  floatgetItalicAngleNative(long hndFont, int fontType)
     Returns tangent of Italic angle of given Font.
native public static synchronized  float[]getNativeLineMetrics(long hFont, int fontSize, boolean isAntialiased, boolean usesFractionalMetrics, int fontType)
     Returns array of values of font metrics corresponding to the given XftFont font object.
native public static synchronized  intgetNumGlyphsNative(long hndFont)
     Returns number of glyphs in specified XftFont if success.
native public static synchronized  float[]getPointsFromFTVector(long ft_vector, int size)
     Returns an array of pairs of coordinates [x1, y1, x2, y2...] from FreeType FT_Vector structure.
public static  voidinitFace(int index, String faceString)
     Initializes specified elements with index specified of famIndices, styles and faces arrays according to the given faceString.
public static  voidinitFaces()
     Initializes famIndices, styles, style names and faces arrays according to the font information available on the system.
public static  voidinitLCIDsTable(Hashtable ht)
    
native public static synchronized  longinitializeFont(LinuxFont linFont, String family, int style, int size, String styleName)
     Initiailzes native Xft font object from specified parameters and returns font handle, also sets font type to the font peer parameter.
static  voidloadLibrary()
    
native public static synchronized  voidpFontFree(long hndFont, long display)
     Disposing XftFont object.
native public static  voidxftDrawSetSubwindowModeNative(long xftDraw, int mode)
    

Field Detail
FC_SLANT_ITALIC
final public static int FC_SLANT_ITALIC(Code)



FC_SLANT_OBLIQUE
final public static int FC_SLANT_OBLIQUE(Code)



FC_SLANT_ROMAN
final public static int FC_SLANT_ROMAN(Code)



FC_WEIGHT_MEDIUM
final public static int FC_WEIGHT_MEDIUM(Code)



faces
public static String[] faces(Code)
List of font faces names of system fonts supported by a system.



facesCount
public static int facesCount(Code)
The number of different fonts installed onto the system.



famIndices
public static int[] famIndices(Code)
List of family indexes in families array corresponding to the faces indexing.



fams
public static Vector fams(Code)
Set of all unique families installed onto the system.



fontStyles
public static int[] fontStyles(Code)
List of font styles of system fonts supported by a system corresponding to faces indexing.



styleNames
public static String[] styleNames(Code)
List of font style names of system fonts supported by a system corresponding to faces indexing.





Method Detail
NativeFreeGlyphBitmap
native public static synchronized void NativeFreeGlyphBitmap(long bitmap)(Code)
Disposes memory block that is used by FreeType FT_Bitmap structure by pointer specified.
Parameters:
  ptr - specified pointer to the memory block



NativeInitGlyphBitmap
native public static synchronized long NativeInitGlyphBitmap(long fnt, char chr)(Code)
Returns pointer to GlyphBitmap structure that represents bitmap with parameters of the character specified or 0 if failures in native code.
Parameters:
  fnt - XftFont handle
Parameters:
  chr - specified char



RemoveFontResource
native public static synchronized int RemoveFontResource(String tempFontFileName)(Code)
Updates specified folder where temporary font created from InputStream stored. This method used in LinuxFont dispose method, it re-caches ~/.fonts directory, after temporary font file is deleted.
Parameters:
  tempFontFileName - directory that is being re-cached name. not null value if success, 0 otherwise



XftDrawSetClipRectangles
native public static boolean XftDrawSetClipRectangles(long xftDraw, int xOrigin, int yOrigin, long rects, int n)(Code)
Sets clipping rectangles in Xft drawable to the specified clipping rectangles.
Parameters:
  xftDraw - XftDraw handle
Parameters:
  xOrigin - x position to start
Parameters:
  yOrigin - y position to start
Parameters:
  rects - handle to the memory block representing XRectangles array
Parameters:
  n - number of rectangles result true if success in native call, false otherwise



canDisplayCharNative
native public static synchronized boolean canDisplayCharNative(long hndFont, char c)(Code)
Returns true, if XftFont object can display specified char.
Parameters:
  hndFont - XftFont handle
Parameters:
  c - specified char



createXftDrawNative
native public static synchronized long createXftDrawNative(long display, long drawable, long visual)(Code)
Returns XftDraw handle created from specified parameters using Xft library.
Parameters:
  display - Display handle
Parameters:
  drawable - Drawable handle
Parameters:
  visual - Visual handle



drawStringNative
native public static synchronized void drawStringNative(long xftDraw, long display, long colormap, long font, int x, int y, char[] chars, int len, long xcolor)(Code)
Draws text on XftDraw with specified parameters using Xft library.
Parameters:
  xftDraw - XftDraw handle
Parameters:
  display - Display handle
Parameters:
  colormap - Colormap handle
Parameters:
  font - XftFont handle
Parameters:
  x - X coordinate where to draw at
Parameters:
  y - Y coordinate where to draw at
Parameters:
  chars - array of chars to draw
Parameters:
  len - length of the array of chars
Parameters:
  xcolor - XColor handle, the color of the text



embedFont
public static Font embedFont(String absolutePath) throws IOException(Code)
Adds new plain font with 1 pt. size from font resource file to the system if similar font wasn't into the system before. Method returns font object, corresponding to the specified resource.
Parameters:
  absolutePath - absolute path to the font resource file



embedFontNative
native public static synchronized String embedFontNative(String absolutePath)(Code)
Returns true if the new font was added to the system, false otherwise. Methods checks if the number of system fonts changed after font configuration was rebuilt.
Parameters:
  absolutePath - absolute path to the font.



freeGlyphOutline
native public static synchronized void freeGlyphOutline(long ptr)(Code)
Disposes memory block that is used by FreeType FT_Outline structure by pointer specified.
Parameters:
  ptr - specified pointer to the memory block



freeXftDrawNative
native public static synchronized void freeXftDrawNative(long xftDraw)(Code)
Destroys XftDraw object.
Parameters:
  xftDraw - XftDraw handle



getAllFonts
public static Font[] getAllFonts()(Code)
Returns an array of instances of 1 pt. sized plain Font objects corresponding to fonts supported by a system.



getAntialiasedFont
native public static long getAntialiasedFont(long font, long display, boolean isAntialiasing)(Code)
Getting antialiasing font from existing font



getExtraMetricsNative
native public static synchronized float[] getExtraMetricsNative(long hFont, int fontSize, int fontType)(Code)
Returns an array of extrametrics of the font:

elem[0] - the average width of characters in the font (Type1 - 0.0f)

elem[1] - horizontal size for subscripts (Type1 - 0.7f * fontHeight)

elem[2] - vertical size for subscripts (Type1 - 0.65f * fontHeight)

elem[3] - horizontal offset for subscripts (Type1 - 0.0f)

elem[4] - vertical offset value for subscripts(Type1 - 0.15f * fontHeight)

elem[5] - horizontal size for superscripts (Type1 - 0.7f * fontHeight)

elem[6] - vertical size for superscripts (Type1 - 0.65f * fontHeight)

elem[7] - horizontal offset for superscripts (Type1 - 0.0f)

elem[8] - vertical offset for superscripts (Type1 - 0.45f * fontHeight)

For TrueType fonts metrics are taken from OS2 table, for Type1 fonts metrics are calculated using coefficients (read FontExtraMetrics comments). OS2 table can be found at http://www.freetype.org/freetype2/docs/reference/ft2-truetype_tables.html#TT_OS2
Parameters:
  hFont - XFT font handle
Parameters:
  fontSize - font size
Parameters:
  fontType - type of the font




getFaces
public static String[] getFaces()(Code)
Returns array of Strings that represent face names of all fonts supported by a system.



getFamilies
public static String[] getFamilies()(Code)
Returns the list of system font families names.



getFamilyFromFaceIndex
public static String getFamilyFromFaceIndex(int faceIndex)(Code)
Returns family name that corresponds to the face with specified face index.
Parameters:
  faceIndex - index of the face in faces array



getFamilyNative
native public static synchronized String getFamilyNative(long hndFont)(Code)
Returns family name of the XftFont object.
Parameters:
  hndFont - XftFont handle



getFontFamiliesNames
native public static synchronized String[] getFontFamiliesNames()(Code)
Returns array of Strings that represents list of all font families names available on the system.



getFontNameNative
native public static synchronized String getFontNameNative(long hndFont)(Code)
Returns face name of the XftFont object.
Parameters:
  hndFont - XftFont handle



getFontPSNameNative
native public static synchronized String getFontPSNameNative(long fnt)(Code)
Returns XftFont's postscript name. Returned value is the name of the font in system default locale or for english langid if there is no results for default locale settings.
Parameters:
  fnt - XftFont handle



getFontStyle
public static int getFontStyle(int faceIndex)(Code)
Returns font style of the font with face having specified index.
Parameters:
  faceIndex - specified index of the face in faces array



getFontStyleName
public static String getFontStyleName(int faceIndex)(Code)
Returns font style name of the font with face having specified index.
Parameters:
  faceIndex - specified index of the face in faces array



getFonts
native public static synchronized String[] getFonts()(Code)
Returns an array of available system fonts names. In case of errors in native code NullPointerException is thrown.



getGlyphCodeNative
native public static synchronized int getGlyphCodeNative(long fnt, char uChar, long display)(Code)
Returns glyph code corresponding to the specified character, null is returned if failure. NullPointerException is thrown in case of Display is null.
Parameters:
  fnt - XftFont handle
Parameters:
  uChar - specified char
Parameters:
  display - Display handle



getGlyphCodesNative
native public static synchronized int[] getGlyphCodesNative(long fnt, String str, int len)(Code)
Returns glyphs code corresponding to the characters in String specified, null is returned if failure. NullPointerException is thrown in case of Display is null.
Parameters:
  fnt - XftFont handle
Parameters:
  uChar - specified char
Parameters:
  display - Display handle



getGlyphInfoNative
native public static synchronized float[] getGlyphInfoNative(long pFnt, char c, int fontSize)(Code)
Returns array of glyph metrics values for the specified character null is returned and NullPointerException is thrown in case of FreeType errors.
Parameters:
  pFnt - XftFont handle
Parameters:
  c - specified char



getGlyphOutline
native public static synchronized long getGlyphOutline(long pFont, char c)(Code)
Returns pointer to the FreeType FT_Outline structure.
Parameters:
  pFont - XFT font handle
Parameters:
  c - specified character



getGlyphPxlInfoNative
native public static synchronized int[] getGlyphPxlInfoNative(long display, long pFnt, char c)(Code)
Returns array of glyph metrics values in pixels for the specified character null is returned and NullPointerException is thrown in case of FreeType errors.
Parameters:
  pFnt - XftFont handle
Parameters:
  c - specified char



getItalicAngleNative
native public static synchronized float getItalicAngleNative(long hndFont, int fontType)(Code)
Returns tangent of Italic angle of given Font. Returned value is null and NullPointerException is thrown if there is Xft error.
Parameters:
  hndFont - XftFont handle
Parameters:
  fontType - type of the font



getNativeLineMetrics
native public static synchronized float[] getNativeLineMetrics(long hFont, int fontSize, boolean isAntialiased, boolean usesFractionalMetrics, int fontType)(Code)
Returns array of values of font metrics corresponding to the given XftFont font object. NullPointerException is thrown in case errors in native code.
Parameters:
  hFont - XftFont handle
Parameters:
  fontSize - size of the font
Parameters:
  isAntialiased - parameter true if antialiased metrics required
Parameters:
  usesFractionalMetrics - true if results calculated using fractional metrics
Parameters:
  fontType - type of the specified font



getNumGlyphsNative
native public static synchronized int getNumGlyphsNative(long hndFont)(Code)
Returns number of glyphs in specified XftFont if success.
Parameters:
  hndFont - XftFont handle



getPointsFromFTVector
native public static synchronized float[] getPointsFromFTVector(long ft_vector, int size)(Code)
Returns an array of pairs of coordinates [x1, y1, x2, y2...] from FreeType FT_Vector structure.
Parameters:
  ft_vector - pointer to the memory block with FT_Vector structure
Parameters:
  size - number of elements in FT_Vector structure



initFace
public static void initFace(int index, String faceString)(Code)
Initializes specified elements with index specified of famIndices, styles and faces arrays according to the given faceString. faceString has format "family name"-"style name"-style.
Parameters:
  index - index of element to identify
Parameters:
  faceString - String defining family name, style name and style in special format



initFaces
public static void initFaces()(Code)
Initializes famIndices, styles, style names and faces arrays according to the font information available on the system.



initLCIDsTable
public static void initLCIDsTable(Hashtable ht)(Code)
Initializes LCID table



initializeFont
native public static synchronized long initializeFont(LinuxFont linFont, String family, int style, int size, String styleName)(Code)
Initiailzes native Xft font object from specified parameters and returns font handle, also sets font type to the font peer parameter. NullPointerException is thrown if there are errors in native code.
Parameters:
  linFont - LinuxFont instance
Parameters:
  family - font family name
Parameters:
  style - style of the font
Parameters:
  size - size of the font
Parameters:
  styleName - style name of the font



loadLibrary
static void loadLibrary()(Code)



pFontFree
native public static synchronized void pFontFree(long hndFont, long display)(Code)
Disposing XftFont object.
Parameters:
  hndFont - XftFont handle
Parameters:
  display - Display handle



xftDrawSetSubwindowModeNative
native public static void xftDrawSetSubwindowModeNative(long xftDraw, int mode)(Code)
Set new subwindow mode to XftDraw object
Parameters:
  xftDraw - XftDraw handle
Parameters:
  mode - new mode



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.