Problem

For text output it is necessary to define a parameter to select the font. There is no special parameter type for this in GDL. You have to script it.

Solution

To avoid input errors you can create a list by the VALUE command. Up to ArchiCAD 9 you have to hard code this. ArchiCAD 10+ provides a REQUEST to get a complete list of all installed fonts. Unfortunatly on windows machines you get a list including all language packs installed either. The list becomes very large.
The following script provides a list for objects in ArchiCAD 9 and below and filters the requested list in ArchiCAD 10+ and cuts off the font extensions.

If you use always the same font name parameter in your objects parameter lists, you can add the script or the CALL to this .GDL-script into your MASTER_GDL.GDL, which will be loaded then each time you start a project file. So any object containingthis parameter has instant access to the value list.

Master- or Parameter Script (long version)

!»»» Definition of a standard fontname list
!    in parameter "Zeichensatz"

!»»» Ermittlung, ob als SUB-GDL aufgerufen (geCALLed)

mkr=" " : sts=REQUEST("NAME_OF_MAIN","",mkr)
gdl=REQ("GDL_VERSION")

IF gdl<1.516 THEN

  !»» Version for ArchiCAD 9-
 
IF STRSTR(mkr,"MASTER_GDL") THEN
    ! … Basic settings in Master_GDL.GDL
    VALUES "Zeichensatz" "«master_gdl»",
      "Arial","Arial Narrow","Avant Garde",
      "Centoury Schoolbook","Chicago","Courier New",
      "Futura Lt BT Westlich","Futura LtCn BT Westlich",
      "Futura Md BT Westlich","Geneva",
      "Helvetica","N Helvetica Narrow",
      "New York","Tahoma","Verdana", CUSTOM
    ELSE
    ! … Individual called settings
    VALUES "Zeichensatz" "Arial Westlich","Arial","Arial Narrow",
      "Avant Garde","Centoury Schoolbook","Chicago","Courier New",
      "Geneva","Helvetica","N Helvetica Narrow",
      "New York","Tahoma","Verdana", CUSTOM
    ENDIF
  END

  ELSE

  !»» Version for ArchiCAD 10+
  DIM fontnames[],exclude[]
  ! … Define font names (/extensions) to extinguish
  exclude[1]='Chinesisch'
  exclude[2]='Türkisch'
  exclude[3]='Hebräisch'
  exclude[4]='Baltisch'
  exclude[5]='Kyrillisch'
  exclude[6]='Thai'
  exclude[7]='Griechisch'
  exclude[8]='Mitteleuropäisch'
  exclude[9]='Arabisch'
  exclude[10]='Japanisch'
  exclude[11]='Hangul'
  ! … can be continued
  excludeN=VARDIM1(exclude)

  ! … Read all fonts in system
  fontN=
REQUEST("FONTNAMES_LIST", "", fontnames)
  ! …same as: fontN=
VARDIM1(fontnames)
  
  ! … Extension, which has always to be cut off
  cutoff="Westlich"

  ! … Reduce list
  DIM fontnames2[]
  j=0
  FOR i=1
TO fontN
    t=1
    ! … is fontname on black list?
    FOR k=1 TO excludeN
     
IF STRSTR(fontnames[i],exclude[k]) THEN t=0
     
NEXT k
   
IF t THEN
      j=j+1
      ! … cut off extension
      t=STRSTR(fontnames[i]," "+cutoff)
     
IF t<=1 THEN t=STRLEN(fontnames[i])+1
      fontnames2[j]=
STRSUB(fontnames[i],1,t-1)
     
ENDIF
    NEXT i

  ! … output to value list
  IF STRSTR(mkr,"MASTER_GDL") THEN
    ! … Basic settings in Master_GDL.GDL
    IF fontN THEN VALUES "Zeichensatz"  "«master_gdl»",fontnames2,CUSTOM
    ELSE
    ! … Individual called settings
    IF fontN THEN VALUES "Zeichensatz" fontnames2,CUSTOM
   
ENDIF

 
ENDIF

Parameter Script (inline object usage)

!»»» Definition of a standard fontname list
!    in parameter "Zeichensatz"


DIM fontnames[],exclude[] fontnames2[]
gdl=REQ("GDL_VERSION")

IF gdl<1.516 THEN

  !»» Version for ArchiCAD 9-
  VALUES "Zeichensatz" "Arial","Arial Narrow","Avant Garde",
    "Centoury Schoolbook","Chicago","Courier New",
    "Futura Lt BT Westlich","Futura LtCn BT Westlich",
    "Futura Md BT Westlich","Geneva",
    "Helvetica","N Helvetica Narrow",
    "New York","Tahoma","Verdana", CUSTOM

  ELSE

  !»» Version for ArchiCAD 10+
  ! … Define font names (/extensions) to
extinguish
  exclude[1]='Chinesisch'
  exclude[2]='Türkisch'
  exclude[3]='Hebräisch'
  exclude[4]='Baltisch'
  exclude[5]='Kyrillisch'
  exclude[6]='Thai'
  exclude[7]='Griechisch'
  exclude[8]='Mitteleuropäisch'
  exclude[9]='Arabisch'
  exclude[10]='Japanisch'
  exclude[11]='Hangul'
  ! … can be continued
  excludeN=VARDIM1(exclude)

  ! … Read all fonts in system
  fontN=REQUEST("FONTNAMES_LIST", "", fontnames)
 
  ! … Extension, which has always to be cut off
  cutoff="Westlich"

  ! … Reduce list
  j=0
  FOR i=1 TO fontN
    t=1
    ! … is fontname on black list?
    FOR k=1 TO excludeN
      IF STRSTR(fontnames[i],exclude[k]) THEN t=0
      NEXT k
    IF t THEN
      j=j+1
      ! … cut off extension
      t=STRSTR(fontnames[i]," "+cutoff)
      IF t<=1 THEN t=STRLEN(fontnames[i])+1
      fontnames2[j]=STRSUB(fontnames[i],1,t-1)
      ENDIF
    NEXT i

  ! … output to value list
  IF fontN THEN VALUES "Zeichensatz" fontnames2,CUSTOM

  ENDIF
Diese Website benutzt Cookies um die Nutzererfahrung zu verbessern. Datenschutzerklärung