MapInfo TEXT OBJECTS

Jacques Paris, May 9, 2003

 

MapInfo Text Objects are created directly on the screen via the Text Tool or programmatically via the CreatText() function or the "Create text" command. They can be modified with the Object Info requester or the "Alter Object" command.

Unlike other objects, the style of Text Objects cannot be modified programmatically to its fullest extent. This is due in particular to the way the height of such object is stored in the .map file. It is expressed in actual coordinate units by the YMIN YMAX coordinates of the rectangular box that will "enclose" the text. It is not thus possible to alter directly the size of a text by changing its point size, one must play with actual coordinates or find some devious ways to retrieve actual point size.

Other strange things happens also with programmatically created Text Objects, such as weird behaviour if the width of the text box is not properly set. There is also some unexplainable shift of a multi-line text if is "centred" otherwise than left.

All these issues are explained and documented in the pdf text that you can view directly from here or download as a zip file from the left panel. This document contains also some code to show how one could circumvent some of the existing drawbacks.

We announced in the introduction that this document could be used in different ways, and here is some more detail what we could do (we = YOU + me). I will try to provide an initial "statement" that I will update with your input. I your are interested in the subject, keep checking here to see it evolve.

1- Getting a better understanding of what are really text objects and of the MB resources to handle them.

 

It should help us in producing a "Guide for handling Text Objects with MB" constructed around a good description of all the MB elements useful in that area, with their limitations and how to implement them in a series of examples.

 

I can quote David Windeler who wrote me after reading the first draft of this paper:

 

"From my own personal experience I have only encountered the problem with the current style command as you documented on page 11. From what I have attempted, invoking the current style can only be done as MapInfo has stated after a text object is added. As of yet, without invoking the text tool, I have not been able to produce the desired results through code. The thing that I find really frustrating is the ease at which all of the other styles can be quickly set using one line, but to do the same for a text object requires a multi-stage process. Why MapInfo chose this route I do not know."

 It would be nice if such worry could be dealt with as completely as possible.

 

Your input:

 

Identification of trouble areas initial page May 9, 2003
Documentation about the MB resources initial page May 9, 2003
Examples of use in various areas
Table of contents of the intended "Guide"

 

2- Drawing specifications for tools to support programmers in that area, and for bringing those tools to the public

 

Even if you could imagine that one day MI might remove some of the actual limitations, many will have to live with versions without those hoped for improvements. There is and will be a "market" for tools that would improve or facilitate the handling of text objects. These tools can be simple procedures (prototype code to include in a program), sub or functions (listing, MBO or DLL) or stand-alone MBX.

 

Your input:

 

Specification of potentially useful tools
Description of existing tools

 

3- Preparing a documented request to MI to consider improvements in that area

 

They are those who think that some formal, well documented request should be presented to MI for seeing at improving the ways MB handle text objects. There are strange behaviours that should be corrected and we can imagine better ways for MB to do things. Whether or not a formal document should be prepared, clearly identifying necessary areas to correct and wish functionalities to improve or add has some validity on its own; it is would seem at first view similar to some previous topics, it will not exactly duplicate them because presented in a different manner.

 

Your input:

 

Necessary corrections to make
Wishful improvements to consider
Document to be submitted to MI