We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.
SOLVED!

Font Type Not Working Through Subtype Parameter

Jarrod Phillips
Enthusiast

Hi All,

 

I am having an issue where I have created a font type parameter in an object subtype, however the font type doesn't want to work in the child object.

 

JarrodPhillips_0-1707201317908.png

 

See script below:

 

 

Parameter in subtype = fta_font_type (string)

 

 

2D script

 

define style "fontStyle1" fta_font_type, fta_font_size, 5, fta_iFont_effects    !LABEL FONT STYLE
style "fontStyle1"

 

Interface Script

 

ui_infield{2} 'fta_font_type', _uiXRight, _uiY, _columnWidth, _fillHeight ui_tooltip "Font Type"
_uiY = _uiY + (_fillHeight + _buttonGap1)

 

Cannot for the life of me workout why it's not working, any assistance would be greatly appreciated.

 

Regards,

 

Jarrod

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia
Archicad 15 - 27
3 ACCEPTED SOLUTIONS

Accepted Solutions
Solution
Barry Kelly
Moderator

That won't give you a list of available fonts.

You will have to type the font name exactly in that field.

 

You can either create your own VALUES list for the 'fta_font_type' variable, where you can list specific font names.

Or this (in the parameter script) will search your operating system and give you a list of all of the installed fonts.

 

 

DIM fontNames[]
n = REQUEST("FONTNAMES_LIST", "", fontNames)
VALUES "fta_font_type" fontNames, CUSTOM

 

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

View solution in original post

Solution

Hi Jarrod

 

ToperBarrientos_0-1707203521876.png

 

We can change the variable name that represents your text style with the parameter shown on the picture (default by the Label subtype).

Apple M1 Pro CPU
RAM 32 GB
1 TB OS: Ventura 13.1

View solution in original post

Solution

Good catch.

I forgot about these fixed name optional parameters.

It seems you can use AC_TextFont_1 up to AC_TextFont_8, should you need different fonts for different reasons all in the one object.

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

View solution in original post

5 REPLIES 5
Solution
Barry Kelly
Moderator

That won't give you a list of available fonts.

You will have to type the font name exactly in that field.

 

You can either create your own VALUES list for the 'fta_font_type' variable, where you can list specific font names.

Or this (in the parameter script) will search your operating system and give you a list of all of the installed fonts.

 

 

DIM fontNames[]
n = REQUEST("FONTNAMES_LIST", "", fontNames)
VALUES "fta_font_type" fontNames, CUSTOM

 

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Solution

Hi Jarrod

 

ToperBarrientos_0-1707203521876.png

 

We can change the variable name that represents your text style with the parameter shown on the picture (default by the Label subtype).

Apple M1 Pro CPU
RAM 32 GB
1 TB OS: Ventura 13.1
Solution

Good catch.

I forgot about these fixed name optional parameters.

It seems you can use AC_TextFont_1 up to AC_TextFont_8, should you need different fonts for different reasons all in the one object.

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Jarrod Phillips
Enthusiast

All excellent solutions, thank you!

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia
Archicad 15 - 27

Hi,

 

Showing the font list can be done without parameter script: https://gdl.graphisoft.com/tips-and-tricks/font-names-list-handling-in-ui-script

 

The parameters which have a font list come from libparts under subtype "Library Master". These are executed when the library is loaded, and their parameters' value ranges are inherited by all other library parts. https://gdl.graphisoft.com/gdl-basics/parameter-logic

 

 

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest