keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
391 stars 107 forks source link

[Developer] Font management in Keyman Developer is overly complex #1093

Open DavidLRowe opened 6 years ago

DavidLRowe commented 6 years ago

2018-08-03 Jim Brase: I am using Version 10.0.1200.0. On further inspection, this is the behavior that I'm seeing. I came across it when trying to change the text size in the keyboard test pane.

In Keyboard / Fonts, the Font Name and Font Size for "Text Editor Code" do not work.

It seems that the font size issue is clearly a bug. But I'm not sure if I'm interpreting the Font Name behavior correctly. Where is "Text Editor Code" applied, and where is "Editor Characters" applied? I'm comparing the text of the KMN file displayed in the Layout tab to the text in the keyboard test pane. I'm interpreting "Text Editor Code" to apply to the code in the KMN file, and "Debugger, Editor Characters" to apply to the text in the keyboard test pane.

2018-08-05 David Rowe: I started a list of all the places one can change the font in Keyman Developer.

I think it would be very valuable to have more detailed documentation on what each does, but I haven't found that on the Keyman site (if it exists), nor taken the time to investigate myself.

2018-08-06 Marc Durdin:

  1. The font size is tied between the Text Editor Code and Debugger, Editor Characters -- you cannot have different font sizes. This is a limitation with the text editor component. So it's not technically a bug!

  2. The plethora of places to change font settings is not good. My ideal was to have the font settings in one place per keyboard layout -- hence the Keyboard Fonts dialog. This functionality is not quite as complete as I want it to be. The information is stored in the project user settings against the current keyboard, for example, with the khmer_angkor keyboard:

    <FileState>
      <ID>id_f347675c33d2e6b1c705c787fad4941a</ID>
      <FullPath>C:\Projects\keyman\keyboards\release\k\khmer_angkor\source\khmer_angkor.kmn</FullPath>
      <IDEState>
        <LayoutDisplay102Key>0</LayoutDisplay102Key>
        <DebugDefaultFont>1</DebugDefaultFont>
        <DebugFont>Courier New|12|   |0</DebugFont>
        <CodeFont>Courier New|12|   |0</CodeFont>
        <CharFont>Courier New|12|   |0</CharFont>
      </IDEState>
      <Debug>True</Debug>
    </FileState>

    (Even the state storage feature is kinda incomplete -- using token separation instead of xml for the font data...)

  3. Debug | View | Font should really open the Keyboard Fonts dialog - with debugger font control selected, and one day I will resolve this. The link between Debugger and Editor Character Font should be controllable in that dialog as well.

  4. View | Character Font and View | Code Font are as you say broken -- I would like to remove those menu entries but there is still a need for them in some editors outside the .kmn source view. More design work to be done here.

  5. Note that Debug | Select System Keyboard doesn't change the font?

  6. The Tools | Options | Editor settings control the defaults, whereas the Keyboard Fonts dialog controls for the current keyboard.

  7. There is also a Character Map font control.

In terms of Jim's question: "Text Editor Code" should apply to the .kmn source, everywhere except comments and quoted strings. Comments and quoted strings should use the "Debugger, Editor Characters" Font. In my testing these controls seemed to work correctly? The "Debugger, Editor Characters" font also applies in various text fields in the "wizard" style interface, e.g. the Details tab.

mcdurdin commented 3 years ago

Per https://community.software.sil.org/t/to-change-font/4484/7 (Keyman Developer 14.0.270):

  • If I change the fonts in View from Consolas 9 to 12, it reverts back to 9 when I restart Keyman Developer
  • If I change it in Tools - Options, Editor, it doesn’t seem to do anything
  • If I change it in Keyboard Fonts, it adjusts it to 12 but reverts back to 9 when I restart Keyman Developer

Other notes:

The font management is still complicated and it looks like another round of cleanup is definitely warranted.

mcdurdin commented 3 years ago

Ref https://community.software.sil.org/t/force-packages-to-define-languages-before-being-compiled/4569/2