Java Doc for NativeFont.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.NativeFont

NativeFont
public class NativeFont (Code)


Field Summary
final public static  intDriverStringOptionsCmapLookup
    
final public static  intDriverStringOptionsLimitSubpixel
    
final public static  intDriverStringOptionsRealizedAdvance
    
final public static  intDriverStringOptionsVertical
    
public static  String[]faces
     List of font types of system fonts initialized using GDI.
public static  int[]famIndices
     List of family indexes in families array corresponding to the faces indexing.
public static  String[]families
     List of all families installed onto the system.
public static  int[]fontStyles
     List of font styles of system fonts initialized using GDI corresponding to faces indexing.
public static  int[]fontTypes
     List of font types of system fonts initialized using GDI corresponding to the faces indexing.
public static  intfontsCount
     The number of different fonts installed onto the system.


Method Summary
native public static  byte[]NativeInitGlyphImage(Glyph glyph)
     Returns bitmap representation of the glyph image in 1 bit per pixel format for the specified Glyph object.
native public static  intRemoveFontResource(String tempFontFileName)
     Removes font resource from file with specified path from the system.
native public static  booleancanDisplayCharNative(long hndFont, char c)
     Returns true if native GDI font can display char, false otherwise.
public static  FontembedFont(String absolutePath)
     Adds new plain font with 1 pt.
native public static  StringembedFontNative(String absolutePath)
     Adds font resource from file to the system.
native public static  voidenumSystemFonts()
     Enumerates system font face names and updates fullNames, fontStyles, fontTypes arrays.
native public static  intgdiPlusDrawDriverChar(long gi, char chr, long font, float x, float y, int flags, double[] matrix)
     Draws transformed char according to the matrix at the specified position.
native public static  intgdiPlusDrawDriverChars(long gi, char text, int length, long font, double[] positions, int flags, double[] matrix)
     Draws string transformed according to the matrix, each character is drawn at the specified positions.
native public static  intgdiPlusDrawDriverString(long gi, String text, int length, long font, float x, float y, double[] positions, int flags, double[] matrix)
     Draws string transformed according to the matrix, each character is drawn at the specified positions.
native public static  intgdiPlusDrawText(long graphicsInfo, String text, int length, long font, float xOffset, float yOffset)
     Draws string at the specified coordinates using GDI+ objects defined in graphics info.
native public static  longgdiPlusGetHDC(long gi)
     Returns hdc object of the GDI+ Graphics object from the GraphicsInfo.
native public static  voidgdiPlusReleaseHDC(long gi, long hdc)
     Releases hdc object in GDI+ Graphics object from the GraphicsInfo.
public static  String[]getAvailableFaces()
     Returns an array of available font face names.
native public static  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[]getFamilies()
     Caches and returns the list of system font families names.
public static  StringgetFamily(int faceIndex)
     Returns font family name that corresponds to the face name with specified index.
native public static  StringgetFamilyNative(long hndFont)
     Returns GDI font object's family name if success, otherwise null and NullPointerException is thrown.
native public static  String[]getFontFamiliesNames()
     Native method returns list of all families installed onto the system.
native public static  StringgetFontNameNative(long hndFont)
     Returns GDI font's face name.
public static  intgetFontStyle(int faceIndex)
     Returns font family style that corresponds to the face name with specified index.
public static  intgetFontType(String name, int style)
     Returns font type (TrueType, Type1 or UndefinedType) for the specified font face name and style.
native public static  String[]getFonts()
     Returns an array of available system TrueType fonts names.
native public static  intgetGlyphCodeNative(long fnt, char uChar)
     Returns glyph code corresponding to the specified character.
native public static  int[]getGlyphCodesNative(long fnt, String str, int len)
     Returns an array of the glyph codes corresponding to the characters from String parameter.
native public static  float[]getGlyphInfoNative(long pFnt, char c, int fontSize)
     Returns an array of glyph precise metrics values for the specified character.
native public static  intgetGlyphOutline(long fnt, char uChar, long polyheaders, int size)
     Returns size of polyheaders structure and set polyheaders pointer to the native array of TTPOLYGONHEADER elements.
native public static  int[]getGlyphPxlInfoNative(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 GDI errors.
native public static  floatgetItalicAngleNative(long hndFont)
     Returns tangent of Italic angle of given Font.
native public static  float[]getNativeLineMetrics(long hFont, int fontSize, boolean isAntialiased, boolean usesFractionalMetrics, int fontType)
     Returns array of values of font metrics corresponding to the given GDI font object.
public static  voidinitLCIDsTable(Hashtable<String, Short> ht)
    
native public static  longinitializeFont(WindowsFont winFont, String name, int style, int size)
     Initialize native GDI font object and return font handle, also sets font type and unicode ranges to the font peer parameter.
static  voidloadLibrary()
    
native public static  intnativeInitLCIDsTable(String[] shortStrings, short[] LCIDs)
     Initialization of the table with LCID values key = ctry_lang, value = LCID value in Windows API format.
native public static  intpFontFree(long hndFont)
     Disposes native font resources.
native public static  voidsetAntialiasing(long graphicsInfo, boolean isAntialiasing)
     Sets antialiasing mode using GDI+ objects defined in graphics info.
public static  voidsetArrays(int[] types, int[] styles, int[] indices, String[] fFaces)
     Sets static arrays to the specified.
public static  voidupdateFontLists()
     Fills fonts and families arrays with current system font data.

Field Detail
DriverStringOptionsCmapLookup
final public static int DriverStringOptionsCmapLookup(Code)
GDI+ DriverStringOptions constants



DriverStringOptionsLimitSubpixel
final public static int DriverStringOptionsLimitSubpixel(Code)



DriverStringOptionsRealizedAdvance
final public static int DriverStringOptionsRealizedAdvance(Code)



DriverStringOptionsVertical
final public static int DriverStringOptionsVertical(Code)



faces
public static String[] faces(Code)
List of font types of system fonts initialized using GDI.



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



families
public static String[] families(Code)
List of all families installed onto the system.



fontStyles
public static int[] fontStyles(Code)
List of font styles of system fonts initialized using GDI corresponding to faces indexing.



fontTypes
public static int[] fontTypes(Code)
List of font types of system fonts initialized using GDI corresponding to the faces indexing.



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





Method Detail
NativeInitGlyphImage
native public static byte[] NativeInitGlyphImage(Glyph glyph)(Code)
Returns bitmap representation of the glyph image in 1 bit per pixel format for the specified Glyph object. null is returned and NullPointerException is thrown in case of GDI errors.
Parameters:
  glyph - specified Glyph object



RemoveFontResource
native public static int RemoveFontResource(String tempFontFileName)(Code)
Removes font resource from file with specified path from the system.
Parameters:
  tempFontFileName - temporary font resource file path zero if native call fails, non-zero if success



canDisplayCharNative
native public static boolean canDisplayCharNative(long hndFont, char c)(Code)
Returns true if native GDI font can display char, false otherwise. NullPointerException is thrown in case of GDI error.
Parameters:
  hndFont - GDI font handle
Parameters:
  c - specified char



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 String embedFontNative(String absolutePath)(Code)
Adds font resource from file to the system. Returns true if font was added successfully, false otherwise.
Parameters:
  absolutePath - String that represent absolute path to the font resource.



enumSystemFonts
native public static void enumSystemFonts()(Code)
Enumerates system font face names and updates fullNames, fontStyles, fontTypes arrays. In case of exceptions in native code NullPointerException is thorwn.



gdiPlusDrawDriverChar
native public static int gdiPlusDrawDriverChar(long gi, char chr, long font, float x, float y, int flags, double[] matrix)(Code)
Draws transformed char according to the matrix at the specified position.
Parameters:
  gi - GraphicsInfo pointer
Parameters:
  chr - specified character
Parameters:
  font - GDI font handle
Parameters:
  x - coordinate X
Parameters:
  y - coordinate Y
Parameters:
  flags - drawing flags, a set of DriverStringOptions constants
Parameters:
  matrix - transformation matrix GDI+ result of the char drawing.



gdiPlusDrawDriverChars
native public static int gdiPlusDrawDriverChars(long gi, char text, int length, long font, double[] positions, int flags, double[] matrix)(Code)
Draws string transformed according to the matrix, each character is drawn at the specified positions.
Parameters:
  gi - GraphicsInfo pointer
Parameters:
  text - specified array of chars
Parameters:
  length - length of the specified chars array
Parameters:
  font - GDI font handle
Parameters:
  positions - an array of positions defined for chars
Parameters:
  flags - drawing flags, a set of DriverStringOptions constants
Parameters:
  matrix - transformation matrix GDI+ result of the char drawing.



gdiPlusDrawDriverString
native public static int gdiPlusDrawDriverString(long gi, String text, int length, long font, float x, float y, double[] positions, int flags, double[] matrix)(Code)
Draws string transformed according to the matrix, each character is drawn at the specified positions.
Parameters:
  gi - GraphicsInfo pointer
Parameters:
  text - specified String
Parameters:
  length - length of the specified String
Parameters:
  font - GDI font handle
Parameters:
  x - origin X coordinate
Parameters:
  y - origin Y coordinate
Parameters:
  positions - an array of positions defined for chars
Parameters:
  flags - drawing flags, a set of DriverStringOptions constants
Parameters:
  matrix - transformation matrix GDI+ result of the char drawing.



gdiPlusDrawText
native public static int gdiPlusDrawText(long graphicsInfo, String text, int length, long font, float xOffset, float yOffset)(Code)
Draws string at the specified coordinates using GDI+ objects defined in graphics info. This method is applicable for drawing without affine transforms.



gdiPlusGetHDC
native public static long gdiPlusGetHDC(long gi)(Code)
Returns hdc object of the GDI+ Graphics object from the GraphicsInfo.



gdiPlusReleaseHDC
native public static void gdiPlusReleaseHDC(long gi, long hdc)(Code)
Releases hdc object in GDI+ Graphics object from the GraphicsInfo.



getAvailableFaces
public static String[] getAvailableFaces()(Code)
Returns an array of available font face names.



getExtraMetricsNative
native public static 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).
Parameters:
  hFont - GDI font handle
Parameters:
  fontSize - font size
Parameters:
  fontType - type of the font




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



getFamily
public static String getFamily(int faceIndex)(Code)
Returns font family name that corresponds to the face name with specified index.
Parameters:
  faceIndex - index of the font face name which family name is to be returned



getFamilyNative
native public static String getFamilyNative(long hndFont)(Code)
Returns GDI font object's family name if success, otherwise null and NullPointerException is thrown.
Parameters:
  hndFont - GDI font handle



getFontFamiliesNames
native public static String[] getFontFamiliesNames()(Code)
Native method returns list of all families installed onto the system.



getFontNameNative
native public static String getFontNameNative(long hndFont)(Code)
Returns GDI font's face name. NullPointerException is thrown in case of GDI error.
Parameters:
  hndFont - GDI font handle



getFontStyle
public static int getFontStyle(int faceIndex)(Code)
Returns font family style that corresponds to the face name with specified index.
Parameters:
  faceIndex - index of the font face name which style is to be returned



getFontType
public static int getFontType(String name, int style)(Code)
Returns font type (TrueType, Type1 or UndefinedType) for the specified font face name and style.
Parameters:
  name - face name
Parameters:
  style - style of the font one of the font type constants FontManager.FONT_TYPE_T1 or FontManager.FONT_TYPE_TT.



getFonts
native public static String[] getFonts()(Code)
Returns an array of available system TrueType fonts names. In case of errors in native code returned value is null.



getGlyphCodeNative
native public static int getGlyphCodeNative(long fnt, char uChar)(Code)
Returns glyph code corresponding to the specified character. null is returned and NullPointerException is thrown in case of GDI errors.
Parameters:
  fnt - GDI font handle
Parameters:
  uChar - specified character



getGlyphCodesNative
native public static int[] getGlyphCodesNative(long fnt, String str, int len)(Code)
Returns an array of the glyph codes corresponding to the characters from String parameter. null is returned and NullPointerException is thrown in case of GDI errors.
Parameters:
  fnt - GDI font handle
Parameters:
  str - specified string
Parameters:
  len - the length of the specified string



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



getGlyphOutline
native public static int getGlyphOutline(long fnt, char uChar, long polyheaders, int size)(Code)
Returns size of polyheaders structure and set polyheaders pointer to the native array of TTPOLYGONHEADER elements.
Parameters:
  fnt - GDI font handle
Parameters:
  uChar - specified character
Parameters:
  polyheaders - pointer to TTPOLYGONHEADER structure
Parameters:
  size - size of buffer with TTPOLYGONHEADER structure



getGlyphPxlInfoNative
native public static int[] getGlyphPxlInfoNative(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 GDI errors.
Parameters:
  pFnt - GDI font handle
Parameters:
  c - specified char



getItalicAngleNative
native public static float getItalicAngleNative(long hndFont)(Code)
Returns tangent of Italic angle of given Font. NullPointerException is thrown if there is GDI error.
Parameters:
  hndFont - GDI font handle



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



initLCIDsTable
public static void initLCIDsTable(Hashtable<String, Short> ht)(Code)
Initializes LCID table



initializeFont
native public static long initializeFont(WindowsFont winFont, String name, int style, int size)(Code)
Initialize native GDI font object and return font handle, also sets font type and unicode ranges to the font peer parameter.
Parameters:
  winFont - Windows font peer
Parameters:
  name - the name of the font
Parameters:
  style - style of the font
Parameters:
  size - font size native GDI font handle.



loadLibrary
static void loadLibrary()(Code)



nativeInitLCIDsTable
native public static int nativeInitLCIDsTable(String[] shortStrings, short[] LCIDs)(Code)
Initialization of the table with LCID values key = ctry_lang, value = LCID value in Windows API format. In case of null parameters method returns required size of arrays to store results.
Parameters:
  shortStrings - array of Strings to fill with languages from locale settings available on the system
Parameters:
  LCIDs - array of shorts to fill with LCID values from locale settings available on the system. size of arrays if success, otherwise returns 0.



pFontFree
native public static int pFontFree(long hndFont)(Code)
Disposes native font resources.
Parameters:
  hndFont - GDI font handle result of GDI library DeleteObject method



setAntialiasing
native public static void setAntialiasing(long graphicsInfo, boolean isAntialiasing)(Code)
Sets antialiasing mode using GDI+ objects defined in graphics info.



setArrays
public static void setArrays(int[] types, int[] styles, int[] indices, String[] fFaces)(Code)
Sets static arrays to the specified.
Parameters:
  types - new values for the fontTypes static array
Parameters:
  styles - new values for the fontStyles static array
Parameters:
  indices - new values for the famIndices static array
Parameters:
  fFaces - new values for the faces static array



updateFontLists
public static void updateFontLists()(Code)
Fills fonts and families arrays with current system font data.



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.