<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Textblock: Font type in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Textblock-Font-type/m-p/226521#M3568</link>
    <description>I did some testig and I think it's a general problem with paragraphs and different fonts.&lt;BR /&gt;
I created a native text in ac with several lines and different fonts each line.&lt;BR /&gt;
then saved as new object.&lt;BR /&gt;
source code is as expected but representation is wrong.&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;paragraph
set style "style 1"
"text"
endparagraph

paragraph
set style "style 2"
"text"
endparagraph

&lt;/PRE&gt;

&lt;BR /&gt;



&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
What am I doing wrong?&lt;BR /&gt;
Dominic</description>
    <pubDate>Fri, 27 Aug 2021 14:16:13 GMT</pubDate>
    <dc:creator>Dominic Wyss</dc:creator>
    <dc:date>2021-08-27T14:16:13Z</dc:date>
    <item>
      <title>Textblock: Font type</title>
      <link>https://community.graphisoft.com/t5/GDL/Textblock-Font-type/m-p/226520#M3567</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I'm trying to create a multipurpose textblock function. Basically its working but I have trouble with setting correct font style and font face.&lt;BR /&gt;Any ideas why? AC finds no errors.&lt;BR /&gt;
&lt;PRE&gt;!-- Init

	_iPgNr = 0
	_iBkNr = 0
	p_to_m = GLOB_SCALE / 1000


!-- Syles

	define style{2} "globStyle" "Papyrus",       2.5 * p_to_m, 4
	define style{2} "S1"        "Arial",         1.0 * p_to_m, 0
	define style{2} "S2"        "Times",         1.5 * p_to_m, 1
	define style{2} "S3"        "Luminari",      4.0 * p_to_m, 0
	define style{2} "S4"        "Arial Black",   4.0 * p_to_m, 32


!-- Base

	hotspot2 0,0


!-- Setup _rt

	dict _rt

	_rt.x = 0.5
	_rt.y = 0.5
	_rt.anchor = 1
	_rt.align = 1
	_rt.style = "globStyle"


!-- First Block

	_rt.line[1].part[1].s = "S3"
	_rt.line[1].part[1].v = "Luminari normal "
	_rt.line[1].part[2].s = "S4"
	_rt.line[1].part[2].v = "Arial Black sup "
	_rt.line[1].part[3].s = "S3"
	_rt.line[1].part[3].v = "Luminari normal "
	_rt.line[1].part[4].s = "S4"
	_rt.line[1].part[4].v = "Arial Black sup"

	_rt.line[2].v = "Times bold"
	_rt.line[2].s = "S2"

	_rt.line[3].v = "Papyrus underline"
	!_rt.line[3].s = "S3" !-&amp;gt; use global style

	_rt.line[4].s = "S1"
	_rt.line[4].v = "Arial normal"

	_rt.line[5].part[1].s = "S1"
	_rt.line[5].part[1].v = ""
	_rt.line[5].part[2].s = "S2"
	_rt.line[5].part[2].v = "Times Bold"

	gosub "rtBlock"

	rect2 _rt.x, _rt.y, _rt.x + _rtWidth, _rt.y + (-1 * _rtHeight)


!-- Second Block

	add2 0,-1* (_rtHeight + 0.1)

	_rt.line[1].s = "S1"
	_rt.line[1].v = "Luminari normal"

	gosub "rtBlock"

	rect2 _rt.x, _rt.y, _rt.x + _rtWidth, _rt.y + (-1 * _rtHeight)



!=======================================================================================================================
end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end !
!=======================================================================================================================




!=======================================================================================================================
"rtBlock":
! ----------------------------------------------------------------------------------------------------------------------
! Mehrzeiliger Text als Richtext ausgeben.
! Es können mit .part[] pro Paragraph mehrere verschiedene Textstile gesetzt werden.
! Stift muss vor Aufruf gesetzt werden.
!-----------------------------------------------------------------------------------------------------------------------
!
! Caller:
! _rt              - (dict)
!    .x            - (real)   x-Position des Richtextes
!    .y            - (real)   y-Position des Richtextes
!    .anchor       - (int)    Textanker
!    .align        - (int)    Ausrichtung der Paragraphen
!    .style        - (string) Style für alle einfachen Zeilen
!    .line      - (array)  Array mit Texten pro Zeile
!
!-----------------------------------------------------------------------------------------------------------------------
!
! Responder:
! _rtHeight        - (real)   Textblock Höhe
! _rtWidth         - (real)   Textblock Breite
!
!-----------------------------------------------------------------------------------------------------------------------
!
! Other:
! _iPgNr           - (int)   Paragraph-Index (am Anfang des Scipts initialisieren und auf 0 setzen)
! _iBkNr           - (int)   Block-Index (am Anfang des Scipts initialisieren und auf 0 setzen)
!
!-----------------------------------------------------------------------------------------------------------------------
!
! Help:
! mögliche Struktur für _rt.line[]:
!    .line.s         - (string) Style (optional)
!    .line.v         - (string) Text
!
! oder:
!    .line.part.s - (string) Style
!    .line.part.v - (string) Text
!
!    * m darf aktuell maximal 4 sein! (weitere Teile werden ignoriert)
!
!=======================================================================================================================

	__nLines = vardim1(_rt.line)

	for q = 1 to __nLines
		_iPgNr = _iPgNr+1
		put _iPgNr

		if haskey(_rt.line&lt;Q&gt;.v) then
			if haskey(_rt.line&lt;Q&gt;.s) then

				paragraph _iPgNr _rt.align, 0, 0, 0, 1
					style _rt.line&lt;Q&gt;.s
					_rt.line&lt;Q&gt;.v + "\ts = " + _rt.line&lt;Q&gt;.s
				endparagraph

			else

				paragraph _iPgNr _rt.align, 0, 0, 0, 1
					_rt.line&lt;Q&gt;.v + "\tgs = " + _rt.style
				endparagraph

			endif

		else
			if haskey(_rt.line&lt;Q&gt;.part) then
				if vardim1(_rt.line&lt;Q&gt;.part) = 1 then

					paragraph _iPgNr _rt.align, 0, 0, 0, 1
						style _rt.line&lt;Q&gt;.part[1].s : _rt.line&lt;Q&gt;.part[1].v
					endparagraph

				endif

				if vardim1(_rt.line&lt;Q&gt;.part) = 2 then

					paragraph _iPgNr _rt.align, 0, 0, 0, 1
						style _rt.line&lt;Q&gt;.part[1].s : _rt.line&lt;Q&gt;.part[1].v
						style _rt.line&lt;Q&gt;.part[2].s : _rt.line&lt;Q&gt;.part[2].v
					endparagraph

				endif

				if vardim1(_rt.line&lt;Q&gt;.part) = 3 then

					paragraph _iPgNr _rt.align, 0, 0, 0, 1
						style _rt.line&lt;Q&gt;.part[1].s : _rt.line&lt;Q&gt;.part[1].v
						style _rt.line&lt;Q&gt;.part[2].s : _rt.line&lt;Q&gt;.part[2].v
						style _rt.line&lt;Q&gt;.part[3].s : _rt.line&lt;Q&gt;.part[3].v
					endparagraph

				endif

				if vardim1(_rt.line&lt;Q&gt;.part) &amp;gt;= 4 then

					paragraph _iPgNr _rt.align, 0, 0, 0, 1
						style _rt.line&lt;Q&gt;.part[1].s : _rt.line&lt;Q&gt;.part[1].v
						style _rt.line&lt;Q&gt;.part[2].s : _rt.line&lt;Q&gt;.part[2].v
						style _rt.line&lt;Q&gt;.part[3].s : _rt.line&lt;Q&gt;.part[3].v
						style _rt.line&lt;Q&gt;.part[4].s : _rt.line&lt;Q&gt;.part[4].v
					endparagraph

				endif

			else

				paragraph _iPgNr _rt.align, 0, 0, 0, 1
				!style _rt.style
				"No Text to print!"
				endparagraph

			endif

		endif

	next q

	_iBkNr = _iBkNr+1
	__bkName = "bk" + str("%",_iPgNr)

	style _rt.style
	textblock_ __bkName 0, _rt.anchor, 0, 1, 1, 0, __nLines,
		get(__nLines)

	richtext2 _rt.x, _rt.y, __bkName

	_dummy = REQUEST ("TEXTBLOCK_INFO", __bkName, _rtWidth, _rtHeight)
	_dummy = removekey(_rt.line)

return&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/Q&gt;&lt;/PRE&gt;
&lt;BR /&gt;Thanks for any help&lt;BR /&gt;&lt;BR /&gt;Dominic&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 06:49:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Textblock-Font-type/m-p/226520#M3567</guid>
      <dc:creator>Dominic Wyss</dc:creator>
      <dc:date>2021-09-14T06:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Textblock: Font type</title>
      <link>https://community.graphisoft.com/t5/GDL/Textblock-Font-type/m-p/226521#M3568</link>
      <description>I did some testig and I think it's a general problem with paragraphs and different fonts.&lt;BR /&gt;
I created a native text in ac with several lines and different fonts each line.&lt;BR /&gt;
then saved as new object.&lt;BR /&gt;
source code is as expected but representation is wrong.&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;paragraph
set style "style 1"
"text"
endparagraph

paragraph
set style "style 2"
"text"
endparagraph

&lt;/PRE&gt;

&lt;BR /&gt;



&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
What am I doing wrong?&lt;BR /&gt;
Dominic</description>
      <pubDate>Fri, 27 Aug 2021 14:16:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Textblock-Font-type/m-p/226521#M3568</guid>
      <dc:creator>Dominic Wyss</dc:creator>
      <dc:date>2021-08-27T14:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: Textblock: Font type</title>
      <link>https://community.graphisoft.com/t5/GDL/Textblock-Font-type/m-p/306116#M3569</link>
      <description>&lt;P&gt;The problem is with font names, all used style's font names have to be correct.&lt;/P&gt;
&lt;P&gt;In GDL the font names visible on the Archicad UI can't be used. REQUEST "FONTNAMES_LIST" returns a list of installed fonts.&amp;nbsp; "Arial" can be "Arial Western" or "Arial Central European", etc...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 10:44:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Textblock-Font-type/m-p/306116#M3569</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2021-09-15T10:44:27Z</dc:date>
    </item>
  </channel>
</rss>

