Menu

#181 HTML: change font family / size based on language

PFE
pfe
nobody
tbd
2013-09-02
2013-07-21
gnosygnu
No

Certain languages (for example, Arabic) may benefit from specific font sizes. This is intended for the polyglot who switches between wikis of different languages.

I will probably create an Option page to handle this behavior

Discussion

  • gnosygnu

    gnosygnu - 2013-07-27
    • status: queued --> in-progress
    • Milestone: v0.7. --> v0.8.
     
  • gnosygnu

    gnosygnu - 2013-07-27

    I started work on this tonight. The first part was to come up with a simple option to control the font. I added this to [[Help:Options/HTML]]. See the screenshot below.

    A few notes:

    • I'm not sure if the CSS fragment properly sets all text sizes. I'm choosing "body, td {font-family: ~{font_name}; font-size: ~{font_size}pt;}" which seems to work well enough. However, I'm leaving the format configurable in case someone wants to try anything else.

    • I also added 2 context menu options to increase / decrease the size. I've made the context menu configurable and will add it as an option page. [[Help:Options/Context_menu]]. I'll probably be adding a number of options, and I'd like the user to be able to remove the options if they are bothersome.

    • The next step is to put a language / wiki selector on this page, and allow the user to override the settings on a per-lang / per-wiki basis. This is slightly complicated and will probably not make this weekend's release.

     

    Last edit: gnosygnu 2013-07-27
  • Anonymous

    Anonymous - 2013-07-27

    pt isn't a unit that should be used for screen display (only for printing), I suggest to use px instead (and adapt the default to make it look the same size as before). --Schnark

     
  • gnosygnu

    gnosygnu - 2013-07-28

    pt isn't a unit that should be used for screen display (only for printing), I suggest to use px instead

    Thanks for the feedback.

    FYI: I was going to use pt b/c I was planning to have one setting control both the HTML font and the widget font (URL box). So a user would enter "Arial" and "12" and it would set both the font of the URL box (12 pt) and the HTML box (12 pt)

    However, I agree with your point. I should use px for the HTML font, and then convert pt to px whenever I come up with that one setting. The conversion appears to be 12 pt = 16 px.

    I've changed the format to the following: body {font-family: ~{font_name}; font-size: ~{font_size}px;}. The default px will be 16 instead of 12. Specifying Arial 16pt looks exactly the same as specifying nothing.

     
  • Anonymous

    Anonymous - 2013-07-31

    The next step is to put a language / wiki selector on this page, and allow the user to override the settings on a per-lang / per-wiki basis. This is slightly complicated and will probably not make this weekend's release.

    A suggestion:
    One method you can use is to make collapsible tables based on language. What I mean by collapsible tables is what Schnark made on "home/wiki/Help:Import/Script" at the bottom of the page. So the headers can be the name of the languages the user has wikis in, and when one expands the headers the wikis that are in that language are listed.
    Now there should be a font name and font size option next to each header, and also next to each wiki (when the header is expanded). So by choosing a font in the header will make that font the default for that language (and choosing a font in the header will override the blank fields next to each wiki when one expands the header), and if a user wants to override this for a specific wiki then he can expand the header and choose the font for that specific wiki.

    hidp123

     
  • gnosygnu

    gnosygnu - 2013-08-01

    One method you can use is to make collapsible tables based on language.

    Thanks for the detailed idea, but I'm planning to do the selector-approach b/c:

    • It only changes one part of the page (i.e.: new selectors)
    • It is simpler (no "grouping/templating" concerns)
    • It can be easily extended to any other Option page
    • It can allow for more configurable selectors (by wiki; multiple wikis/langs)
     
  • gnosygnu

    gnosygnu - 2013-08-05
    • Expected release: v0.8.0 --> v0.8.2
     
  • gnosygnu

    gnosygnu - 2013-08-05

    I didn't want to include this for v0.8.0. I'll work on it for v0.8.1, but there is a possibility it may go into v0.8.2

     
  • gnosygnu

    gnosygnu - 2013-08-16
    • Expected release: v0.8.2 --> v0.8.3
     
  • gnosygnu

    gnosygnu - 2013-08-16

    I'm moving this to v0.8.3. It may even move to a later release. Unfortunately, it looks like I'd have to redo the Options infrastructure to handle this correctly, so it's going to take some effort

     
  • gnosygnu

    gnosygnu - 2013-08-26
    • status: in-progress --> queued
    • Expected release: v0.8.3 --> tbd
    • Milestone: v0.8. --> v0.9.
     
  • gnosygnu

    gnosygnu - 2013-08-26

    I'm putting this item on hold. It needs a redesign of the user preferences, and I'd rather wait a little longer before I embark on this.

     
  • gnosygnu

    gnosygnu - 2013-09-02
    • status: queued --> pfe
    • Milestone: v0.9.* --> PFE
     
  • gnosygnu

    gnosygnu - 2013-09-02

    I'm moving this ticket to PFE. I will implement this on the next redesign of the Options pages, but I want to hold off for a while.

     

Anonymous
Anonymous

Add attachments
Cancel