<?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 How do I make Text Stretchy? in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/How-do-I-make-Text-Stretchy/m-p/216499#M14783</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;We have an object we have modified. It uses a REQUEST to read the zone name from the zone it is placed into. This is not a Zone Stamp but an object that more or less duplicates the info from a Zone Stamp.&lt;BR /&gt;
&lt;BR /&gt;
Right now that name is a TEXT2 and it's not stretchy, but if we have a long zone name we'd like to be able to stretch it to break into two lines. &lt;BR /&gt;
&lt;BR /&gt;
I have found several references to possible needing to use TEXTBLOCK and PARAGRAPH but can't seem to get it to work, seemingly in over my GDL head.&lt;/T&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 19 Dec 2012 17:26:07 GMT</pubDate>
    <dc:creator>kevin b</dc:creator>
    <dc:date>2012-12-19T17:26:07Z</dc:date>
    <item>
      <title>How do I make Text Stretchy?</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-do-I-make-Text-Stretchy/m-p/216499#M14783</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;We have an object we have modified. It uses a REQUEST to read the zone name from the zone it is placed into. This is not a Zone Stamp but an object that more or less duplicates the info from a Zone Stamp.&lt;BR /&gt;
&lt;BR /&gt;
Right now that name is a TEXT2 and it's not stretchy, but if we have a long zone name we'd like to be able to stretch it to break into two lines. &lt;BR /&gt;
&lt;BR /&gt;
I have found several references to possible needing to use TEXTBLOCK and PARAGRAPH but can't seem to get it to work, seemingly in over my GDL head.&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 19 Dec 2012 17:26:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-do-I-make-Text-Stretchy/m-p/216499#M14783</guid>
      <dc:creator>kevin b</dc:creator>
      <dc:date>2012-12-19T17:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make Text Stretchy?</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-do-I-make-Text-Stretchy/m-p/216500#M14784</link>
      <description>You will need to use RICHTEXT2. &lt;BR /&gt;
&lt;BR /&gt;
I use this code snippet as a building block when I need to do this. &lt;BR /&gt;
&lt;BR /&gt;
Parameters:
&lt;PRE&gt;Typical settings for all parameters
===============
Hidden:		N/A
Indent:		N/A
Bold:		N/A
U:			N/A
===============

Variable:	rhtxt
Type:		text
Name:		Text
Value:		abc

Variable:	text_pen
Type:		Pen
Name:		Text pen
Value:		7

Variable:	font_type
Type:		text
Name:		Font style
Value:		Arial

Variable:	txt_size
Type:		Real
Name:		Size (points)
Value:		2

Variable:	wfact
Type:		Real
Name:		Leter width factor
Value:		1.00

Variable:	chfact
Type:		Real
Name:		Text width factor
Value:		1.00

Variable:	bBold
Type:		boolean
Name:		Bold
Value:		Off

Variable:	bItalic
Type:		boolean
Name:		Italic
Value:		Off

Variable:	bUnderline
Type:		boolean
Name:		Underline
Value:		Off

Variable:	bStrike
Type:		Real
Name:		Strike through
Value:		Off

Variable:	widthset
Type:		Length
Name:		Paragraph width
Value:		0'-3"
&lt;/PRE&gt;

2D Script:
&lt;PRE&gt;LINE2 0,0, widthset, 0

GOSUB 10  !! General
GOSUB 100 !! Text
GOSUB 200 !! Hotspots

!! ======================================
				END
!! ======================================

10:  !! General	
	PEN text_pen
	unID = 1
	faceC = 1*bBold+2*bItalic+4*bUnderline+128*bStrike
	txt_sizeC = txt_size*0.3527777 !! (mm to Pt conversion)
	size = widthset*1000/glob_scale	 

	DEFINE STYLE{2} "AC_STYLE_0" font_type, txt_sizeC, faceC
RETURN 


100: !! Text	
	PARAGRAPH "PRG_1" 1, 0, 0, 0, 1
		PEN text_pen
		SET STYLE "AC_STYLE_0"
		"Test text to make the color option work"
	ENDPARAGRAPH
		
	TEXTBLOCK "TEXTBLOCK_1" size,
		1, 0, wfact, chfact, 1, rhtxt 
	
	RICHTEXT2 0, 0, "TEXTBLOCK_1"
RETURN 


200: !! Hotspots		
	! ===== Selection Hotspots
	nul = REQUEST ('TEXTBLOCK_INFO', "TEXTBLOCK_1", wid, hit)
	
	w=wid*glob_scale/1000
	h=hit*glob_scale/1000
	
	HOTSPOT2 w/2, -h/2
	HOTSPOT2 w, -h
	HOTSPOT2 0, -h
	HOTSPOT2 0, 0
	!HOTSPOT2 w, 0
	
	! ===== Width Hotspots
	HOTSPOT2  0,        0, unID, widthset, 1+128 : unID = unID+1 !b
	HOTSPOT2  widthset, 0, unID, widthset, 2     : unID = unID+1 !m
	HOTSPOT2 -1,        0, unID, widthset, 3     : unID = unID+1 !r
RETURN&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Dec 2012 20:12:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-do-I-make-Text-Stretchy/m-p/216500#M14784</guid>
      <dc:creator>Erich</dc:creator>
      <dc:date>2012-12-19T20:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make Text Stretchy?</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-do-I-make-Text-Stretchy/m-p/216501#M14785</link>
      <description>Thank you for sharing the code!  (Now I can complete our object!)</description>
      <pubDate>Tue, 26 Nov 2013 14:58:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-do-I-make-Text-Stretchy/m-p/216501#M14785</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-26T14:58:14Z</dc:date>
    </item>
  </channel>
</rss>

