Opened 12 years ago

Closed 12 years ago

#35 closed defect (fixed)

Font Preferences Don't Work

Reported by: alms Owned by: gb
Priority: major Milestone:
Component: IDE Version: 1.1
Keywords: preferences fonts Cc:

Description

The font preferences panel doesn't work. Clicking either of the two buttons brings up a font selection panel, but making a selection doesn't do anything. The preference panel doesn't show the newly chosen font/style/size, and the the editor windows don't use the newly chosen font/style/size. This is true both for the Default Font and for the Modeline Font.

Change History (9)

comment:1 Changed 12 years ago by gb

  • Resolution set to worksforme
  • Status changed from new to closed

The font options in the preferences panel are supposed to set the default fonts used for subsequently opened documents; tooltips in those dialogs are supposed to make that clear, but it might be clearer if there was some static text in the dialog that explained this.

There should probably be something on the context menus associated with text views that allows you to change the font in an open document.

The mechanism as it's implemented seems to work as intended; there are all kinds of secondary issues (should it work this way ? if so, should static text in the preferences pane make it clearer ? Why don't the "save", "reset", "revert" buttons in the preferences pane highlight themselves as they should ?) that may deserve separate bug reports, but I don't see a bug here.

comment:2 follow-up: Changed 12 years ago by alms

  • Resolution worksforme deleted
  • Status changed from closed to reopened

The font options in the preferences panel are supposed to set the default fonts used for subsequently opened documents.

They do not do this for me. Here is more detail on the behavior that I'm seeing:

When I choose the "Fonts" pane of the "Preferences" panel, the pane shows two sections. The top section is labeled "Default Font" and the bottom section is labeled "Modeline Font." Each of these sections consists of a static text item on the left displaying the current value of that font, and a "Change Font..." button on the right.

When the pane is displayed, it shows "Courier 12.0" as the Default Font and "Courier New Bold Italic 10" as the Modeline Font. (The "10" is cropped on the right because the static text item is a little too small, but I can select the text and drag to the right to make it autoscroll. In this way I can see that it says "10" and not "10.0". The inconsistency between the two font size displays should be a separate bug.)

OK, now I click on the "Change Font..." button in the "Default Font" section. It brings up a separate little floating font selection panel. In that panel I choose a different font and size, say "Arial" and "14". Nothing changes in the preferences pane. Specifically, the static text item in he "Default Font" section still reads "Courier 12.0". I click the "Save" button in the bottom right of the Preferences panel, and there is still no change. I close the little floating font selection panel and there is still no change. I create a new text window, a new listener, and I open an existing .lisp file, and all still use Courier 12 rather than Arial 14. I click the "Change Font..." button again and the little floating font selection panel comes up showing Courier 12 rather than Arial 14. Closing and reopening the Preferences panel at any point in this sequence of events doesn't change the behavior. The behavior is the same for Modeline Font as it is for Default Font.

The log file doesn't show any messages being sent.

Let me know if there's anything you'd like me to look at to try to figure out what's going on here. In the meantime I'll do some more poking around (though I don't have much more time to work on it tonight).

comment:3 in reply to: ↑ 2 Changed 12 years ago by alms

Replying to alms:

I click the "Change Font..." button again and the little floating font selection panel comes up showing Courier 12 rather than Arial 14.

Actually, it shows Arial 14 if I close it and open it again right away. But if I close and reopen the preferences panel and then click on "Change Font..." again, it goes back to Courier 12.

comment:4 follow-up: Changed 12 years ago by gb

As the tooltip also notes, variable-width fonts can't be used (they're actually rejected a bit earlier than the tooltip implies.)

It'd definitely be nicer to exclude variable-width fonts from the font panel before it's even displayed, or to make it clearer than it is that selecting a variable-width font was a no-op.

Try switching back and forth between (for instance) Courier and Monaco.

comment:5 in reply to: ↑ 4 Changed 12 years ago by alms

Try switching back and forth between (for instance) Courier and Monaco.

I see the same behavior switching back and forth between Courier and Monaco and between different sizes of Courier. It looks like #/changeFont: is not being called at all.

comment:6 Changed 12 years ago by gb

I'd bet that #/changeFont: is being sent to the first responder, but that the first responder in your case is something other than the preferences panel.

To see if that's the case, try to ensure that the preferences panel is immediately under the font panel (in Z order) when selecting a font.

If I don't do this, I see behavior like that which you've described.

(At any point in time, there's an ordered sequence of views, windows, and other objects called "the responder chain"; messages like #/changeFont: are sent to each object on the chain until one of them responds. There may be a #/changeFont: handler on a text view or elsewhere; it should probably pass the message to the next responder in most cases.)

comment:7 Changed 12 years ago by alms

OK, try this:

  1. start up the IDE by doing (require "cocoa")
  2. select OpenMCL/Preferences...
  3. select "Fonts" tab
  4. select "Change Font..." from the "Default Font" section
  5. switch between Courier and Monaco and choose some different sizes. You should see the changes immediately reflected in the preferences panel.
  6. do not close any of the windows or panels. Select File/New?.
  7. switch between Courier and Monaco and choose some different sizes. Now the changes won't be reflected in the preferences panel (and won't, in fact, be taking effect).

This is different from the behavior I was seeing before. When I did this a couple of days ago, I couldn't get the font selection to ever work. But this is repeatable for me right now, and maybe other people will be able to repeat it, too, and maybe it'll point to a fix that will also fix my original problem.

comment:8 Changed 12 years ago by gb

That's consistent with what I'd expect; the font panel is just broadcasting a #/changeFont: up the responder chain. It "works" if the preferences pane is the first responder, but other windows/views might also respond.

The font panel might also pick up the current font in one of those intervening windows. If so, I'm not sure how to persuade it not to. (IIRC, it was necessary to claim that editor text views used the font panel for some obscure reason; it might be better to claim that they don't.)

I can arrange that the font panel sends a more specific message and targets the preferences pane explicitly in response to clicks on the "Change Font ..." buttons, and that'll fix at least some of the problem. (We might also try to make the preferences panel more modal.)

comment:9 Changed 12 years ago by gb

  • Resolution set to fixed
  • Status changed from reopened to closed

I think that this is straightened out in SVN now.

Note: See TracTickets for help on using tickets.