Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DavidLRowe opened this issue Aug 6, 2018 · 2 comments
Open
Milestone

Comments

@DavidLRowe
Copy link

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.

  • The Font Size specified for "Debugger, Editor Characters" is applied to both "Text Editor Code" and "Debugger, Editor Characters".
    • If you try to change the font size for "Text Editor Code", you can change the number in the dialogue box, but it has no effect.
    • When you come back into the dialogue, you will find that the size has been restored to match that for "Debugger, Editor Characters".
  • The behavior for Font Name is slightly different. As with Font Size, the Font Name specified for "Debugger, Editor Characters" is applied in both places.
    • If you try to change the font name for "Text Editor Code", it lets you change the font, but it has no effect.
    • When you reenter the dialogue, the new font name that you specified for "Text Editor Code" will still be displayed, but it will continue to have no effect.

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.

  • View | Character Font
  • View | Code Font
  • Keyboard | Fonts
  • Debug | View | Font
  • Debug | View | Use Editor Character Font
  • Tools | Options | Editor tab
  • Debug | Select System Keyboard

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...)

  1. 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.
  2. 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.
  3. Note that Debug | Select System Keyboard doesn't change the font?
  4. The Tools | Options | Editor settings control the defaults, whereas the Keyboard Fonts dialog controls for the current keyboard.
  5. 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 mcdurdin added this to the Future milestone Oct 23, 2018
@mcdurdin mcdurdin changed the title [Developer] Font setting issues [Developer] Font management in Keyman Developer is overly complex Sep 29, 2019
@mcdurdin mcdurdin modified the milestones: Future, 14.0 Feb 25, 2020
@mcdurdin mcdurdin modified the milestones: 14.0, P10S4 Mar 8, 2020
@mcdurdin mcdurdin modified the milestones: P10S4, P10S10 Apr 7, 2020
@mcdurdin mcdurdin modified the milestones: P10S10, P10S15 Jul 9, 2020
@mcdurdin mcdurdin modified the milestones: P10S15, 14.0 Sep 4, 2020
@mcdurdin mcdurdin modified the milestones: 14.0, B14S5 Nov 22, 2020
@mcdurdin mcdurdin modified the milestones: B14S5, B14S7 Dec 21, 2020
@mcdurdin mcdurdin modified the milestones: B14S7, Future Mar 1, 2021
@mcdurdin
Copy link
Member

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
  • The reported issue appears to arise if there is an untitled blank keyboard project in use which is not saved on exit.

Other notes:

  • Source view of .kps uses wrong font (there may be other places as well)
  • Tools - Options, Editor, Default font size is lost in restart (but not if you change font name as well)
  • There's no way to 'reset to default' font
  • We should reduce the number of places fonts can be set (View/Code Font and View/Character Font may not be necessary -- and don't work in some editors such as source view of .kps)?
  • The linked font size option in Tools/Options does not appear to have any affect (and should be visible in the keyboard fonts dialog as well).

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants