class PRealFont: public PFont

A class representing the attributes of a text font that is representable on a PCanvas.

Inheritance:


Public Methods

[more] PRealFont ()
Create a real font for the canvas from the specified font request information.
[more]virtual PDIMENSION GetHeight ( BOOL inPixels = FALSE ) const
Get the height of font.
[more]virtual PDIMENSION GetAvgWidth ( BOOL inPixels = FALSE ) const
Get the average width of the characters in the font.
[more]virtual PDIMENSION GetMaxWidth ( BOOL inPixels = FALSE ) const
Get the width of the widest character in the font.
[more]virtual PDIMENSION GetAscent ( BOOL inPixels = FALSE ) const
Get the ascent, height of characters above the line they sit on.
[more]virtual PDIMENSION GetDescent ( BOOL inPixels = FALSE ) const
Get the descent, height of characters below the line thet sit on.
[more]virtual PDIMENSION GetLeading ( BOOL inPixels = FALSE ) const
Get the recommended distance between lines in consecutive lines of text all in this font.
[more]PDIMENSION PointsToPixelsX ( PDIMENSION x ) const
Convert a horizontal dimension from printer points (1/72 inch) to pixels of the device the font was realised for.
[more]PDIMENSION PointsToPixelsY ( PDIMENSION y ) const
Convert a vertical dimension from printer points (1/72 inch) to pixels of the device the font was realised for.
[more]PDIMENSION PixelsToPointsX ( PDIMENSION x ) const
Convert a horizontal dimension from pixels of the device the font was realised for to printer points (1/72 inch).
[more]PDIMENSION PixelsToPointsY ( PDIMENSION y ) const
Convert a vertical dimension from pixels of the device the font was realised for to printer points (1/72 inch).

Public

[more] New functions for class

Protected Fields

[more]PDIMENSION deviceResX
Device resolution of the canvas for printer point conversion functions.


Inherited from PFont:

Public Classes

oenum Style

Public Methods

ovirtual PObject* Clone() const
ovirtual Comparison Compare( const PObject & obj ) const
oPCaselessString GetDescription() const
oPCaselessString GetFacename() const
oPDIMENSION GetSize() const
oWORD GetStyles() const
oBOOL IsBold() const
oBOOL IsItalic() const
oBOOL IsUnderlined() const

Public

Overrides from class PInteractor

New methods for class

Protected Fields

oPCaselessString facename
oPDIMENSION size
oWORD styles


Inherited from PObject:

Public

Run Time Type functions

Comparison functions

I/O functions

Miscellaneous functions


Documentation

A class representing the attributes of a text font that is representable on a PCanvas.

A canvas is always associated with a particular device. This may be the screen as in PInteractorCanvas or a printer as in PPrinterCanvas. A particular device will only be able to render certain fonts, eg a screen device would only be able to display fonts that were installed on the system. A printer would typically only be able to render fonts that are built into it.

The original PFont only has enough information for a request to the device of a font. Once a font is realised, more detailed information about the exact font metrics is available.

Note all sizes (height, width etc) for fonts are in printers points (1/72 inch).

o PRealFont()
Create a real font for the canvas from the specified font request information. If no canvas is specified then the screen device is used, ie via a PInteractorCanvas. If no font information is provided then the system font returned by PApplication::GetSystemFont() is used.

o New functions for class

ovirtual PDIMENSION GetHeight( BOOL inPixels = FALSE ) const
Get the height of font. This is the distance from the characters on one line and the characters on the next line of text.

The height is the ascent plus the descent and the leading.

Returns:
height of the real font.
Parameters:
inPixels - Whether returned in pixels or printer points.

ovirtual PDIMENSION GetAvgWidth( BOOL inPixels = FALSE ) const
Get the average width of the characters in the font.

Returns:
average width of the real font.
Parameters:
inPixels - Whether returned in pixels or printer points.

ovirtual PDIMENSION GetMaxWidth( BOOL inPixels = FALSE ) const
Get the width of the widest character in the font.

Returns:
maximum width of the real font.
Parameters:
inPixels - Whether returned in pixels or printer points.

ovirtual PDIMENSION GetAscent( BOOL inPixels = FALSE ) const
Get the ascent, height of characters above the line they sit on.

The height is the ascent plus the descent. The size is the height plus the leading.

Returns:
ascent of the real font.
Parameters:
inPixels - Whether returned in pixels or printer points.

ovirtual PDIMENSION GetDescent( BOOL inPixels = FALSE ) const
Get the descent, height of characters below the line thet sit on. This would apply to characters such as 'g' or 'q' for instance.

The height is the ascent plus the descent. The size is the height plus the leading.

Returns:
descent of the real font.
Parameters:
inPixels - Whether returned in pixels or printer points.

ovirtual PDIMENSION GetLeading( BOOL inPixels = FALSE ) const
Get the recommended distance between lines in consecutive lines of text all in this font.

The height is the ascent plus the descent. The size is the height plus the leading.

Returns:
leading of the real font.
Parameters:
inPixels - Whether returned in pixels or printer points.

oPDIMENSION PointsToPixelsX( PDIMENSION x ) const
Convert a horizontal dimension from printer points (1/72 inch) to pixels of the device the font was realised for.

Returns:
converted dimension.
Parameters:
x - Horizontal dimension to convert.

oPDIMENSION PointsToPixelsY( PDIMENSION y ) const
Convert a vertical dimension from printer points (1/72 inch) to pixels of the device the font was realised for.

Returns:
converted dimension.
Parameters:
y - Vertical dimension to convert.

oPDIMENSION PixelsToPointsX( PDIMENSION x ) const
Convert a horizontal dimension from pixels of the device the font was realised for to printer points (1/72 inch).

Returns:
converted dimension.
Parameters:
x - Horizontal dimension to convert.

oPDIMENSION PixelsToPointsY( PDIMENSION y ) const
Convert a vertical dimension from pixels of the device the font was realised for to printer points (1/72 inch).

Returns:
converted dimension.
Parameters:
y - Vertical dimension to convert.

oPDIMENSION deviceResX
Device resolution of the canvas for printer point conversion functions.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.