|
From: Chris K <gnu...@li...> - 2006-04-04 19:24:24
|
Ethan Merritt wrote:
> On Tuesday 04 April 2006 11:23 am, Chris K wrote:
>
> I'll have a look at the rest of your comments later, but for this one...
>
I have an additional comment about term.c's enhanced_recursion. It accepts
character for the name of the new font with this code:
> localfontname = p;
> while ((ch = *p) > ' ' && ch != '=' && ch != '*')
> ++p;
> save = *(savepos=p);
I strongly propose that '}' should also be excluded from the valid font name
characters, and therefore '{' as well. The new code would be:
> localfontname = p;
> while ((ch = *p) > ' ' && ch != '=' && ch != '*'
> && ch != '{' && ch != '}')
> ++p;
> save = *(savepos=p);
This way input like "{/Symbol}" does not parse a local font name of "Symbol}"
>> The usual enhanced_recursion calls will need feedback about the text layout size
>> from the terminal driver.
>
> I don't think this is true. Could you give a specific example?
> For instance, the postscript driver itself knows little about text
> layout. That information is not available until much later, when
> the output file is run through a postscript interpreter
> (e.g. a PostScript printer, ghostscript). By then it is far to late
> to feed any information back to the gnuplot core routines.
>
I think that answers my question. The output terminal code does not need to
measure the size of the text in order to succeed. It should have been obvious,
but other drivers do such measurements, so I was uncertain.
>> If a terminal decided to handle the enhanced text
>> codes internally in the term->put_text call, without using the
>> enhanced_recursion, would it still need to send any information to
>> gnuplot about the text size?
>
> I'm still not sure what information you mean.
> Are you talking about the estimated string length?
> That estimation is actually done by a special driver that
> does nothing else - estimate.trm.
>
I had noticed the estimate.trm file, but I did see where it was being used.
What I am hoping to do is have port.trm just put the enhanced text string (with
all the font commands and special codes) into the output. No calls to
enhanced_recursion|open|writec|flush will be made.
Thus port.trm will never get any measurement of the size of the enhanced text.
Then (perhaps much later), the Haskell code must parse the enhanced text as much
like enhanced_recursion as possible while rendering it. Thus I have been
reading that code very very closely.
I have created a parser in Haskell to comprehend the enhanced text strings.
(Including an amusingly complete emulation of strtod) (And I mimicked the
current code for enhanced_recursion so I will need a bug fix from the menu in my
last message). The next thing to do is to transform this into Render and Pango
instructions for display.
--
Chris
|