4D v13

PV Add font

Home

 
4D View v13
PV Add font

PV Add font 


 

PV Add font ( area ; name ) -> Function result 
Parameter Type   Description
area  Longint in 4D View area
name  String in Font name
Function result  Longint in Font ID

The PV Add font command adds a font to the area by its name and returns its ID.

If name already exists, the PV Add font command returns its ID (the number can also be obtained using the PV GET FONT LIST command).

For more information on how fonts associated with a 4D View area work, refer to the section PV Style, Introduction.

Example  

This method also works with toggle: it removes a font from the 4D View area or associates it if it has already been removed.

 C_STRING(255;$FontName`Name of font to add/remove from Area
 
 ARRAY LONGINT($FontNumArray;0) `Font numbers array
 ARRAY STRING(255;$FontNameArray;0) `Font names array
 C_INTEGER($Position`Position of the font in the number and name arrays
 
 $FontName:="Arial"
 
 PV GET FONT LIST(Area;$FontNumArray;$FontNameArray`List of available fonts
 $Position:=Find in array($FontNameArray;$FontName)
 
 If($Position=-1) `$FontName font is unavailable for the area?
    $Position:=Size of array($FontNameArray)+1 `We will add it
    INSERT IN ARRAY($FontNameArray;$Position`Resize...
    INSERT IN ARRAY($FontNumArray;$Position`...arrays
    $FontNameArray{$Position}:=$FontName  `Assign name of new font
    $FontNumArray{$Position}:=PV Add font(Area;$FontName`Assign font number
 
 Else `$FontName font is already present in the area
    PV REMOVE FONT(Area;$FontNumArray{$Position}) `Remove it
 End if

 
PROPERTIES 

Product: 4D
Theme: PV Style
Number: 15889

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D View 6.8

 
SEE ALSO 

PV GET FONT LIST
PV REMOVE FONT