*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> ufmGetCharMetrics (3w)              
Title
Content
Arch
Section
 

Contents


ufmGetCharMetrics(3w)					 ufmGetCharMetrics(3w)


NAME    [Toc]    [Back]

     ufmGetCharMetrics - get character metrics by character code

C SYNOPSIS    [Toc]    [Back]

     #include <ufm.h>

     int ufmGetCharMetrics(unsigned int	nTypefaceHandles,
	  unsigned int *typefaceHandles, int charCodeType,
	  unsigned int nCharCodes, void	*charCodes,
	  unsigned int *nCharMetrics, ufmCharMetrics **charMetrics)

DESCRIPTION    [Toc]    [Back]

     ufmGetCharMetrics gets the	scalable metrics for specified character codes
     from font metric files.  If ufmGetCharMetrics does	not find the metrics
     for a specified character code, it	returns	the metrics for	the default
     character.	 Set nCharCodes	to 0 if	you want to get	character metrics for
     all characters in a specified typeface.

     You can get scalable character metrics only for those typefaces which
     have the flag scalableMetrics set to 1 in their ufmTypeface data
     structures, that is, for those typefaces for which	font metric files were
     found.

     nTypefaceHandles specifies	the number of entries (typeface	handles) in
     the array typefaceHandles.

     typefaceHandles specifies one or more handles for open typefaces.	Use
     the function ufmOpenTypeface to open a typeface, and get a	handle for
     that typeface.

     If	you specify more than one typeface handle, ufmGetCharMetrics will find
     the font metric files for specified typefaces.  Then it will look for the
     scalable metrics data for a specified character in	the font metric	file
     for the first specified typeface.	If it does not find that data in that
     file, it will look	for that data in the next font metrics file.  It will
     stop looking as soon as it	finds the requested character metrics data.
     If	it cannot find that data for a specified character, it will return the
     metrics data for the default character.  If ufmGetCharMetrics cannot find
     the metrics data even for the default character, it will return an	error
     code.

     charCodeType specifies a 1-byte character code (UFM_BYTE1), a Unicode
     UCS-2 code	(UFM_UCS2), a Unicode UCS-4 code (UFM_UCS4), a 2-byte
     character code (UFM_BYTE2), or a 4-byte character code (UFM_BYTE4).

     nCharCodes	specifies the number of	elements in the	array charCodes.  Set
     nCharCodes	to 0 if	you want character metrics data	for all	characters in
     a specified typeface.  If you want	character metrics data for only	some
     characters, use the array charCodes to specify the	character codes	of
     those characters.





									Page 1






ufmGetCharMetrics(3w)					 ufmGetCharMetrics(3w)



     ufmGetCharMetrics stores the character metrics data it finds into an
     array of data structures of the type (ufmCharMetrics).  Then it returns
     the number	of entries (nCharMetrics) in that array	and the	address	of
     that array	(charMetrics).

     When you are finished with	the array (charMetrics), you can free it by
     calling ufmFreeCharMetrics	with the argument values that were returned by
     ufmGetCharMetrics.

     All scalable metrics values provided by ufmGetCharMetrics are specified
     in	ems.  You can scale such values	to an appropriate point	size by	using
     the formula:

	      scaled value = scalable-value x point-size x resolution /	72.0

     You can scale such	values to an appropriate pixel size by using the
     formula:

	      scaled-value = scalable-value x pixel-size

     The character advance width in pixels for a given resolution can be
     calculated	from the scalable character advance width in ems by using the
     formula:

	      advance-width = scalable-advance-width x point-size x resolution / 72.0

     The result	is usually rounded to the nearest pixel.

SEE ALSO    [Toc]    [Back]

      
      
     ufmFreeCharMetrics(3w), ufmGetCharMetricsByName, ufmOpenTypeface(3w).

DIAGNOSTICS    [Toc]    [Back]

     If	ufmGetCharMetrics is not able to allocate the memory it	needs, it will
     return the	value UFM_OUT_OF_MEMORY.  If the values	of one or more
     arguments are not valid, ufmGetCharMetrics	will return the	value
     UFM_INVALID_VALUE.	 UFM_OUT_OF_MEMORY and UFM_INVALID_VALUE are defined
     in	the header file	<ufm.h>.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
ufmGetCharMetricsByName IRIX get character metrics by name or CID code
ufmFreeCharMetrics IRIX free character metrics
wcrtomb FreeBSD convert a wide-character code to a character (restartable)
mbrtowc FreeBSD convert a character to a wide-character code (restartable)
csrc HP-UX Builds a DCE character and code set registry on a host
wcwidth FreeBSD number of column positions of a wide-character code
ungetwc Tru64 Push a byte or wide-character code back into the input stream
ungetc Tru64 Push a byte or wide-character code back into the input stream
wchrtbl IRIX generate character classification and conversion tables for ASCII and supplementary code sets
mvwins_wch Tru64 Insert a complex character and rendition before the character under the cursor in a Curses window
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service