Jacques,
Thanks for the information. The problem is when I compute the height of
the text based on these computations ( h/72*scale/39.37 ) and use this to
compute y1 and y2, and then import the mif file into a tab file, I can
then check the size of the text at the correct map scale. Sometimes, the
size is correct and many other times it is different by a few points.
Do you know any reasons that could explain this?
Thanks.
Martin
On Wed, 11 Sep 2002, Jacques Paris wrote:
> 1 point = 1/72 of an inch 5 points > 5/72 of an inch.
>
> At scale 1:50000, that would represent 50000 * 5 / 72 inches >~ 88.4722
> meters.
>
> The difference between y1 and y2 should thus be 88.5 meters. That between X1
> and X2 is more problematic. If it is not wide enough to house the text, the
> text will appear but the behaviour of this object will be erratic at edit
> time in particular (part will not refresh etc...). If it is too long, it may
> interfere unduly with nearby objects. But the height of the text itself will
> not be affected.
>
> A partially solution to that is to use the createtext() function having to
> specify only one x,y and the windowid set at the proper scale, it uses the
> default font that should be set at what you want. Then get its width with
> objectgeography (..xmnini,..xmaxi); you can now recreate it with the right
> parameters in the create text statement.
> You can use also this technique to find the correct height to use also
>
> Preparation:
> 1 - set your mapper at the 1:50000 scale and locate a point close to the
> left edge and at mid height>CX,CY
> 2 - set the current font for the mapper at 5 points of the desired font
> without the previous calculations.
>
> Set coordsys table <your_table>
> Dim o as object
> o=createtext(frontwindow(),CX,CY,"test de texte",0,0,0)
> dim difV as float
> dim difH as float
> difV=objectgeography(o,4)-objectgeography(o,2)
> print "Height "+str$(difV)
> difH=objectgeography(o,3)-objectgeography(o,1)
> print "Width "+str$(difH)
> create text into window frontwindow() o "test de text" (CX,CY+difV)
> (CX+difH, CY) font ("Arial",25,0,0)
>
> As this works in the MB window, it should be feasible within a WOR.
>
> Jacques Paris
> -----Original Message-----
> From: Martin Tyberg [mailto:[EMAIL PROTECTED]]
> Sent: September 11, 2002 13:14
> To: [EMAIL PROTECTED]
> Subject: MI-L Specifying Text MBR in MIF files
>
>
> Hi,
>
> Does anyone know how to properly specify the MBR for a text object in
> a MIF file so that when the MIF file is imported into MapInfo, the
> height of the text object in points is equal to the size of the text
> that I want at a specific scale?
>
> For the MBR that I compute in the MIF file, the text object ends up
> being bigger or smaller in point units at the scale that I want to
> plot my map.
>
> Basically, what values of x1,y1 and x2,y2 should I specify for a text
> object such that the text object ends up being imported into MapInfo as a
> 5 pt high text, for example, at a scale of 50000?
>
> Thanks in advance.
>
> Martin
>
>
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> Message number: 2980
>
>
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 2983