This is all obscure, and doesn't appear to apply anyway.  I don't want to 
color the text for various keywords, I want to set the font-family for all 
text in the node - preferably without needing to enumerate every kind of 
keyword, which names I don't think are documented anywhere.

It seems that there may be some machinery the could be used in pbc.doFont(),  
but when I forced the dictionary for @node rest to contain ('font-family', 
'Georgia'), which would seem to be the expected contents, the font in my 
test node wasn't changed.  Also, the way the key/values are obtained from 
the @node processing makes it impossible to extract those values from the 
@node.  There is some magic involved here, and I'm not surprised if there's 
a bug.

In the standard Leo distro, those @nodes are only used for @language forth, 
and the Forth colorizer handler uses special bespoke classes.  So there may 
be a bug that the special Forth code works around but no other language 
hits.

On Wednesday, February 15, 2023 at 10:32:48 AM UTC-5 Edward K. Ream wrote:
On Wed, Feb 15, 2023 at 8:09 AM Thomas Passin <tbp1...@gmail.com> wrote:
@ekr:  "I suspect that adding a node @font rest fonts will suffice."

I must be missing the magic way to do this

It looks like there is a bug somewhere. I expected the following to work:


1. Create a test node (headline doesn't matter, but mine is --- tests of 
@language rest) containing:

@language rest
**Bold**
plain rest text.
*Italics*

2. Save your test file with the test node selected.

3. Restart your test file with --trace=coloring in effect.

On startup, the trace will show a large trace of the configDict, containing 
many keys. The start of this trace will looks something like this:

configDict: {'blank': '#E5E5E5',
'comment': 'solarized-orange',
'comment.hashbang': '#408080',
...

Then you'll see the usual syntax coloring trace. Something like this:

mainLoop
NEW NODE: --- tests of @language rest

setTag: rest.leokeyword                    0  14       '@language rest' 
rest_main:
setTag: rest.keyword2                      0   8             '**Bold**' 
rest_main:match_at_language
setTag: rest.keyword4                      0   9            '*Italics*' 
rest_main:rest_rule14

Your task is to set these key/value pairs to your liking.

A. In myLeoSettings.leo, under the node Language-specific fonts and colors,
create an organizer node (with  rest as the headline)

B. Under this rest organizer node, create other nodes to set specific 
settings. Use the traces as your guide.

For example, I created the node: @color rest-keyword3-color = red
The body text doesn't matter: put any comments there you like.

*Bug: *settings don't affect the configDict.  I'll investigate.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/52577808-474f-47a6-aa34-423a9fd92bd7n%40googlegroups.com.

Reply via email to