Menu

#20 Template graph blocks - key font setting and "set" commands

open
nobody
None
5
2010-02-17
2010-02-12
asitdepends
No

1.
Am I able to change the font for texts in key? I tried several ways but failed.
I'd like to change the font for texts in keys.

2.
Could you implement following "set" commands?

set alabelfont
set atitlefont
set keyfont

I think they are quite useful.

Best regards.

Discussion

  • Jan Struyf

    Jan Struyf - 2010-02-16

    If you define your key block external to the graph block, then:

    set font psh
    begin key
    text "hello"
    end key

    should work.

    I'm a bit reluctant to define too many of these set commands. I think we need a better mechanism to specify defaults for parts of the graph.

    Probably a graph template block that is used as a template when creating a new graph.

    E.g.,

    begin template graph
    axis font psh
    key font rm
    end template graph

    begin graph
    ...
    end graph

    Would something like this be a good alternative?

    By the way: I uploaded a new GLE with some of the fixes you requested here:
    <http://www.gle-graphics.org/cvs.html>

    Jan

     
  • asitdepends

    asitdepends - 2010-02-17

    I tried the new version. It works perfectly.
    Thank you. It saved some of my life :)
    I agree that your block template is much better idea than more "set" commands.
    I think that It may be helpful if I can choose a template when I write a graph block .

    begin template graph name template1
    ...
    end template graph

    begin graph extends template1
    ...
    end graph

    We can also have default template.

    begin template graph default
    ...
    end template graph.

    I think I have too many feature requests :)
    Anyway, GLE is excellent already.

    ps.

    It seems that some of the new features in the change logs are not in the manual, like "background" in key module.
    I think that you can add a line of guide in the Support & Docs > Documentation section for people to check the change logs.

     
  • asitdepends

    asitdepends - 2010-02-17

    Oops, I forgot to write about the key font problem.
    When I turned off the texlabels option, I could change the font.
    It seems that "set texlabels 1" makes all the lables including key texts use the tex font.
    In somes cases, I have lines with equations and lines without equations in keys for a graph.
    I solved the problem by using "helvet" tex package and "\textsf".
    But, I think that plain texts without equations are more clear in non-tex fonts.
    Non-tex fonts are also convenient when I need to edit GLE-made figures in other graphics tools like Inkscape or Illustrator.
    If I can turn on or off the "texlabels" option for each part selectively, It may be convenient.
    Anyway this is a minor problem. You can forget this :)

     
  • Jan Struyf

    Jan Struyf - 2010-02-17

    Thank you for suggesting the named templates. This is a great idea and I think it is the way we should go.

    I'm currently busy with other GLE projects, but I will definitely put it on my TODO list.

    This is the current plan for major things (small things are squeezed in as they come):

    - Dynamic typing mechanism (this will add array and hash table types to GLE's scripting language)
    - Allow FOR/NEXT IF/THEN/ELSE in graph blocks
    - Template graph blocks (this is new now :-))
    - Allow editing of graphs in QGLE
    - Improve / rewrite 3D graph module

    Don't hold back on adding feature requests to the tracker. It will take a while before they 'll get implemented as we don't have many active developers, but it will allow me to pick the most useful / interesting one first :-).

    About the texlabels command:

    set texlabels 1 indeed uses TeX font for all labels (graph + key). This is the correct behaviour for this command. Some people need font consistency across an entire document and this is the way to accomplish this with GLE + LaTeX.

    If you only want to use LaTeX for some parts, then it is probably better to turn texlabels off and to indicate where you want to use LaTeX by using the "\tex{}" construct.

    For example:

    set texlabels 0
    begin key
    marker square text "Some normal text"
    marker triangle text "Some text with the formula \tex{$\sqrt{x}$}"
    end key

    Does this help?

    Best Regards,

    Jan

     
  • Jan Struyf

    Jan Struyf - 2010-02-17
    • summary: Key font setting and some "set" commands --> Template graph blocks - key font setting and "set" commands
     
  • asitdepends

    asitdepends - 2010-02-18

    I just forgot about "\tex{}" though I must have read about it from the manual.
    It is sufficient to me. Thank you.
    New features you mentioned are fascinating !
    I really want them. I'm expecting the new GLE with them.

     

Log in to post a comment.

MongoDB Logo MongoDB