Jump to content

PMFont: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
 
Line 8: Line 8:
{| border="1"
{| border="1"
|-
|-
!Entity
!Entity||Type||Scope||Short Description
!Type
!Scope
!Short Description
|-
|-
|PMFont
|PMFont||constructor||public||Constructs the font object from characters string.
|constructor  
|public
| Constructs the font object from characters string.
|-
|-
|name
|name||method||public||Returns the face name of the font.
|method  
|public
| Returns the face name of the font.
|-
|-
|size
|size||method||public||Returns the point size of the font.
|method  
|public
|Returns the point size of the font.
|-
|-
|attrs
|attrs||method||public||Returns the font attributes.
|method  
|public
|Returns the font attributes.
|-
|-
|sys_font
|sys_font||static method||public||Returns a system font name.
|static method  
|public
| Returns a system font name.
|}
|}


Line 46: Line 28:
{| border="1"
{| border="1"
|-
|-
|''fontname
|''fontname''
''
|The format of the font name string is as follows:
|The format of the font name string is as follows:
   
  <point size>.<face name>(.<modifer>(.<modifier>...
&lt;point size&gt;.&ltface name&gt(.&ltmodifer&gt(.&ltmodifier&gt...
 
where:
where:
 
:<point size> is the point size of the font
&lt;point size&gt; is the point size of the font
:<face name> is the face name of the font
&lt;face name&gt; is the face name of the font
:<modifier> is one of the following:
&lt;modifier&gt; is one of the following:


* Bold
* Bold
Line 63: Line 41:
* Outline
* Outline
* Strikeout
* Strikeout
 
 
Examples are "12.New Times Roman" and "10.Helvetica.Bold.Italic"
Examples are "12.New Times Roman" and "10.Helvetica.Bold.Italic"


 
'''Note:''' Modifiers can be used to create a font with a combination of the listed attributes. Do not use modifiers if a true font of that type is already available. For example, use "10.Helvetica Bold" instead of "10.Helvetica.Bold."
'''Note:''' Modifiers can be used to create a font with a combination of
|}
the listed attributes. Do not use modifiers if a true font of that
type is already available. For example, use "10.Helvetica Bold"
instead of "10.Helvetica.Bold."
 
 
|}


'''Code:'''
'''Code:'''
Line 80: Line 52:
== method name ==
== method name ==
Returns the face name of the font.
Returns the face name of the font.
; Source: pm_font.h:69  
; Source: pm_font.h:69
; Params:
; Params:
{| border="1"
{| border="1"
|-
|-
|''result
|''result''
''
|A buffer in which the face name is returned.
|A buffer in which the face name is returned.
|-
|-
|''size
|''size''
''
|This is the size of the buffer specified by the ''result'' parameter. If the call is successful, this is overwritten with the number of bytes copied into the buffer.
|This is the size of the buffer specified by the ''result'' parameter. If the call is successful, this is overwritten with the number of bytes copied into the buffer.
|}
|}
; Code:
; Code:
  public '''char''' * ''''''name'''''' (
  public '''char''' * ''''''name'''''' (
Line 112: Line 82:
Returns a system font name.
Returns a system font name.


Allows the application to ask for details about
Allows the application to ask for details about the user interface defined fonts.
the user interface defined fonts.


; Source: pm_font.h:98
; Source: pm_font.h:98
Line 119: Line 88:
{| border="1"
{| border="1"
|-
|-
|''id
|''id''
''
|Font identity:
|Font identity:
  ''SYSFNT_WINDOWTEXT'' System font for window text.
  ''SYSFNT_WINDOWTEXT'' System font for window text.
Line 126: Line 94:
  ''SYSFNT_MENU'' System font for menu text.
  ''SYSFNT_MENU'' System font for menu text.
  ''SYSFNT_ICONTEXT'' System font for icon text.
  ''SYSFNT_ICONTEXT'' System font for icon text.
  ''SYSFNT_PREFORMATTED'' System-fixed width font for preformatted text.
  ''SYSFNT_PREFORMATTED'' System-fixed width font for preformatted text.
 
|}
|}
; Code:
; Code:

Latest revision as of 00:21, 2 July 2023

The PMFont class manages the use of fonts. You can construct, destruct, copy, and assign objects of this class.

Source
pm_font.h:25
Author
Dmitry A Steklenev
Version
unknown

Contents

Entity Type Scope Short Description
PMFont constructor public Constructs the font object from characters string.
name method public Returns the face name of the font.
size method public Returns the point size of the font.
attrs method public Returns the font attributes.
sys_font static method public Returns a system font name.

constructor PMFont

Constructs the font object from characters string.

Source
pm_font.h:58
Param
fontname The format of the font name string is as follows:
<point size>.<face name>(.<modifer>(.<modifier>...

where:

<point size> is the point size of the font
<face name> is the face name of the font
<modifier> is one of the following:
  • Bold
  • Italic
  • Underscore
  • Outline
  • Strikeout

Examples are "12.New Times Roman" and "10.Helvetica.Bold.Italic"

Note: Modifiers can be used to create a font with a combination of the listed attributes. Do not use modifiers if a true font of that type is already available. For example, use "10.Helvetica Bold" instead of "10.Helvetica.Bold."

Code:

public 'PMFont' ( const char * fontname )

method name

Returns the face name of the font.

Source
pm_font.h:69
Params
result A buffer in which the face name is returned.
size This is the size of the buffer specified by the result parameter. If the call is successful, this is overwritten with the number of bytes copied into the buffer.
Code
public char * 'name' (
                                      char * result ,
                                      int size ) const

method size

Returns the point size of the font.

Source
pm_font.h:72
Code
public LONG 'size' () const

method attrs

Returns the font attributes.

Source
pm_font.h:74
Code
public const FATTRS * 'attrs' () const

static method sys_font

Returns a system font name.

Allows the application to ask for details about the user interface defined fonts.

Source
pm_font.h:98
Param
id Font identity:
SYSFNT_WINDOWTEXT System font for window text.
SYSFNT_WINDOWTITLES System font for window title text.
SYSFNT_MENU System font for menu text.
SYSFNT_ICONTEXT System font for icon text.
SYSFNT_PREFORMATTED System-fixed width font for preformatted text.  
Code
public static const char * 'sys_font' (int id )