| java.lang.Object org.apache.harmony.awt.gl.font.NativeFont
NativeFont | public class NativeFont (Code) | | |
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 int | RemoveFontResource(String tempFontFileName) Removes font resource from file with specified path from the system. | native public static boolean | canDisplayCharNative(long hndFont, char c) Returns true if native GDI font can display char, false otherwise. | public static Font | embedFont(String absolutePath) Adds new plain font with 1 pt. | native public static String | embedFontNative(String absolutePath) Adds font resource from file to the system. | native public static void | enumSystemFonts() Enumerates system font face names and updates fullNames, fontStyles, fontTypes arrays. | native public static int | gdiPlusDrawDriverChar(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 int | gdiPlusDrawDriverChars(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 int | gdiPlusDrawDriverString(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 int | gdiPlusDrawText(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 long | gdiPlusGetHDC(long gi) Returns hdc object of the GDI+ Graphics object from the GraphicsInfo. | native public static void | gdiPlusReleaseHDC(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 String | getFamily(int faceIndex) Returns font family name that corresponds to the face name with
specified index. | native public static String | getFamilyNative(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 String | getFontNameNative(long hndFont) Returns GDI font's face name. | public static int | getFontStyle(int faceIndex) Returns font family style that corresponds to the face name with
specified index. | public static int | getFontType(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 int | getGlyphCodeNative(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 int | getGlyphOutline(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 float | getItalicAngleNative(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 void | initLCIDsTable(Hashtable<String, Short> ht) | native public static long | initializeFont(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 void | loadLibrary() | native public static int | nativeInitLCIDsTable(String[] shortStrings, short[] LCIDs) Initialization of the table with LCID values key = ctry_lang, value = LCID value
in Windows API format. | native public static int | pFontFree(long hndFont) Disposes native font resources. | native public static void | setAntialiasing(long graphicsInfo, boolean isAntialiasing) Sets antialiasing mode using GDI+ objects defined in graphics info. | public static void | setArrays(int[] types, int[] styles, int[] indices, String[] fFaces) Sets static arrays to the specified. | public static void | updateFontLists() Fills fonts and families arrays with current system font data. |
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.
|
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 |
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.
|
|
|