Jump to content
Developer Wiki and Function Reference Links ×

Text Size Control


Assembly

Recommended Posts

Text size is controlled by layer.

Is there a function to set absolute text size.

What I'm thinking is creating a PIO that will be viewed at 2 scales

1-50 & 1-5 and using the Class to control visibility.

Say

Nameclass(Notes-Scale5)

Nameclass(Notes-Scale50)

For this to work I need to control the absolute size of the text regardless of the layer scale it is inserted on.

Link to comment

The typical way to do this is to set your text sizes so that you canmultiply it by the layer scale so it will be the correct size. Something like:

pioTextSize := ((GetObjectVariableReal(pioHandle, 17)/GetLScale(GetLayer(pioHandle))) * 72) / 25.4;

This was taken from a Vectorscript list post by Charles Changeler on 1 May 2007. The Subject was Re: Text size of PIOs.

Link to comment

Procedure textpio;

Var

layerscalestring:string;

PIOrecordhandle:handle;

pioHandle:handle;

PIOwallhandle:handle;

pioTextSize:real;

PIOname,

pioText: String;

PIOlayerscale:integer;

BEGIN;

IF getcustomobjectinfo(PIOname,PIOHandle,PIOrecordhandle,PIOwallhandle)=TRUE

THEN

BEGIN;

PIOlayerscale:=getlscale(PIOHandle);

layerscalestring:=num2str(5,PIOlayerscale);

TextOrigin(0,0);

textsize(300mm/PIOlayerscale);

BeginText;

Concat

(Ptext,'This is the scale 100 size','

',layerscalestring)

EndText;

textsize(75mm/PIOlayerscale);

BeginText;

Concat

(Ptext,'This is the scale 25 size')

EndText;

hmove(lnewobj,0,-50);

textsize(15mm/PIOlayerscale);

BeginText;

Concat(Ptext,

'This is the scale 5 size')

EndText;

hmove(lnewobj,0,-70);

END;

END;

run(textpio);

Link to comment

Procedure textpio;

Var

layerhandle:handle;

layerscalestring:string;

PIOrecordhandle:handle;

pioHandle:handle;

PIOwallhandle:handle;

pioTextSize:real;

PIOname,

pioText: String;

PIOlayerscale:integer;

textheight:real;

scale1:real;

scale2:real;

scale3:real;

classstring1,

classstring2,

classstring3:STRING;

BEGIN;

classstring1:=Concat('Note-Text-',num2str(0,pscale1));

classstring2:=Concat('Note-Text-',num2str(0,pscale2));

classstring3:=Concat('Note-Text-',num2str(0,pscale3));

textheight:=ptextheight;

IF getcustomobjectinfo(PIOname,PIOHandle,PIOrecordhandle,PIOwallhandle)=TRUE

THEN

BEGIN;

layerhandle:=getlayer(PIOHandle);

PIOlayerscale:=getlscale(layerhandle);

layerscalestring:=num2str(5,PIOlayerscale);

TextOrigin(0,0);

Nameclass(classstring1);

textsize(textheight*pscale1/PIOlayerscale);

BeginText;

Ptext

EndText;

Nameclass(classstring2);

textsize(textheight*pscale2/PIOlayerscale);

BeginText;

Ptext

EndText;

textsize(textheight*pscale3/PIOlayerscale);

Nameclass(classstring3);

BeginText;

Ptext

Endtext;

END;

END;

run(textpio);

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...