KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Write Pro Font Sizes and Toolbar
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: October 3, 2022

The 4D Write Pro Toolbar allows the font size of text to be modified similarly to other word processing applications.
The font size can be updated using the drop down:


The font size can also be modified procedurally using the WP SET ATTRIBUTES command. When allowing doing so, it should also be taken into consideration fonts not listed in the drop down of the toolbar will not get displayed in the tool bar. For example, the lowest font size on the drop down is 8. If the font is set to a size lower than 8 such as 6 with the following code:
WP SET ATTRIBUTES(WParea; wk font size; 6)

Then the drop down will not show the current size:


Below are the font sizes listed in an array and a collection, this can be used in code to set font sizes to select one that will be listed.

ARRAY LONGINT($al_wpFontSizes;18)
$al_wpFontSizes{1}:=8
$al_wpFontSizes{2}:=9
$al_wpFontSizes{3}:=10
$al_wpFontSizes{4}:=11
$al_wpFontSizes{5}:=12
$al_wpFontSizes{6}:=13
$al_wpFontSizes{7}:=14
$al_wpFontSizes{8}:=16
$al_wpFontSizes{9}:=18
$al_wpFontSizes{10}:=20
$al_wpFontSizes{11}:=22
$al_wpFontSizes{12}:=24
$al_wpFontSizes{13}:=26
$al_wpFontSizes{14}:=28
$al_wpFontSizes{15}:=32
$al_wpFontSizes{16}:=36
$al_wpFontSizes{17}:=48
$al_wpFontSizes{18}:=72

C_COLLECTION($c_wpFontSizes)
$c_wpFontSizes:=New collection(8,9,10,11,12,13,14,16,18,20,22,24,26,28,32,36,48,72)