<?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 center text in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/center-text/m-p/147331#M13666</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hello,&lt;BR /&gt;
&lt;BR /&gt;
How to center a text according to its length?&lt;BR /&gt;
I modified the script to add MASTER_BAIE_X01.gsm a text but I can not focus my text window.&lt;BR /&gt;
Thank you in advance.&lt;BR /&gt;
&lt;BR /&gt;
code:&lt;BR /&gt;
DEFINE STYLE "own" "arial", 1.5, 1, 0&lt;BR /&gt;
&lt;BR /&gt;
IF texopt then&lt;BR /&gt;
SET STYLE "own"&lt;BR /&gt;
string = opt&lt;BR /&gt;
width = STW (string) / 1000 * GLOB_SCALE&lt;BR /&gt;
TEXT2 width/2,-0.05, string&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
IF texvitrage then&lt;BR /&gt;
SET STYLE "own"&lt;BR /&gt;
string = vitrage&lt;BR /&gt;
width = STW (string) / 1000 * GLOB_SCALE&lt;BR /&gt;
TEXT2 width/2,-0.15, string&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
&lt;IMG src="http://img15.hostingpics.net/pics/815319window.jpg" /&gt;&lt;/R&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 24 May 2023 09:46:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-05-24T09:46:51Z</dc:date>
    <item>
      <title>center text</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/center-text/m-p/147331#M13666</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hello,&lt;BR /&gt;
&lt;BR /&gt;
How to center a text according to its length?&lt;BR /&gt;
I modified the script to add MASTER_BAIE_X01.gsm a text but I can not focus my text window.&lt;BR /&gt;
Thank you in advance.&lt;BR /&gt;
&lt;BR /&gt;
code:&lt;BR /&gt;
DEFINE STYLE "own" "arial", 1.5, 1, 0&lt;BR /&gt;
&lt;BR /&gt;
IF texopt then&lt;BR /&gt;
SET STYLE "own"&lt;BR /&gt;
string = opt&lt;BR /&gt;
width = STW (string) / 1000 * GLOB_SCALE&lt;BR /&gt;
TEXT2 width/2,-0.05, string&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
IF texvitrage then&lt;BR /&gt;
SET STYLE "own"&lt;BR /&gt;
string = vitrage&lt;BR /&gt;
width = STW (string) / 1000 * GLOB_SCALE&lt;BR /&gt;
TEXT2 width/2,-0.15, string&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
&lt;IMG src="http://img15.hostingpics.net/pics/815319window.jpg" /&gt;&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 24 May 2023 09:46:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/center-text/m-p/147331#M13666</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-24T09:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: center text</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/center-text/m-p/147332#M13667</link>
      <description>You can, but you don't NEED to. &lt;BR /&gt;
 &lt;BR /&gt;
Instead of calculate the text dimension and move it, simply define it as "centered" using the "2" or "5" align-code &lt;BR /&gt;
 &lt;BR /&gt;
DEFINE STYLE "own" "arial", 1.5, &lt;FONT color="#FF0000"&gt;&lt;B&gt;2&lt;/B&gt;&lt;/FONT&gt;, 0 &lt;BR /&gt;
 &lt;BR /&gt;
then place it at x=0 coordinate. &lt;BR /&gt;
 &lt;BR /&gt;
TEXT2 &lt;FONT color="#FF0000"&gt;&lt;B&gt;0&lt;/B&gt;&lt;/FONT&gt;,- 0.05, string</description>
      <pubDate>Fri, 17 May 2013 07:56:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/center-text/m-p/147332#M13667</guid>
      <dc:creator>rocorona</dc:creator>
      <dc:date>2013-05-17T07:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: center text</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/center-text/m-p/147333#M13668</link>
      <description>That depends on whether you want left or right justified text but in the centre of the window or if you just want centre justified text.&lt;BR /&gt;
&lt;BR /&gt;
Centre justified is the easiest - you just have to change the anchor code.&lt;BR /&gt;
&lt;BR /&gt;
DEFINE STYLE "own" "arial", 1.5, &lt;FONT color="#ff0000"&gt;2&lt;/FONT&gt;, 0&lt;BR /&gt;
&lt;BR /&gt;
2 will be centre justified with the anchor at the top of the text (height wise).&lt;BR /&gt;
5 will be centre justified with the anchor in the centre of the text (height wise).&lt;BR /&gt;
8 will be centre justified with the anchor at the bottom of the text (height wise).&lt;BR /&gt;
&lt;BR /&gt;
If you want to keep the left or right justification then you will have to find the length of the text string as you have already done.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Fri, 17 May 2013 07:59:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/center-text/m-p/147333#M13668</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2013-05-17T07:59:15Z</dc:date>
    </item>
  </channel>
</rss>

