Bug report #1752

Font label settings not working on OS X

Added by John Tull over 15 years ago. Updated over 13 years ago.

Status:Closed
Priority:Low
Assignee:Tom Elwertowski
Category:Symbology
Affected QGIS version: Regression?:No
Operating System:OS X Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:11812

Description

When changing the font settings for labels in the properties dialog for a vector layer, the font selector is brought up but changes to the fonts make no effect on the label display. Looking at the qgs file, the fonts stay on their default of Lucinda Grande 12.

qgscomposerlegendwidget.cpp Magnifier - qgscomposerlegendwidget.cpp font dialog (9.93 KB) John Tull, 2009-08-05 08:36 PM

qgscomposerlabelwidget.cpp Magnifier - qgscomposerlabelwidget.cpp mac font dialog (2.58 KB) John Tull, 2009-08-05 08:37 PM

History

#1 Updated by William Kyngesburye over 15 years ago

Hmm, works for me. My 1.1.0 build.

I tested with OTF, TTF (flat), PostScript (resource fork), and dfont fonts. And both activated by placement in standard font folders and by a font manager (Linotype Fontexplorer (free)).

#2 Updated by John Tull over 15 years ago

It still is not working for me regardless of a cmake or xcode build. I am using qt-4.5.2, so I am thinking it might have something to do with Qt. Which qt are you using?

#3 Updated by William Kyngesburye over 15 years ago

4.4.something. I've been holding off on 4.5 until I hear more about whether Qgis is supposed to be compatible with 4.5, or just "it should be, but...". So far I'm just hearing about issues like this one.

Are you using the standard version or the Cocoa version?

#4 Updated by John Tull over 15 years ago

I am using the carbon version. The Cocoa version had different problems that I could not get past with qgis.

#5 Updated by William Kyngesburye over 15 years ago

Ah, after updating to Qt 4.5(.2), font selection now does not work for me either.

#6 Updated by John Tull over 15 years ago

Unfortunately, did not fix this problem.

#7 Updated by William Kyngesburye over 15 years ago

Here's a possibility: the font selection now uses the system font dialog:

QFileDialog

On Mac, native dialogs are now used when calling show, open, or exec on a QFileDialog, QColorDialog, QPrintDialog, or QFontDialog (i.e not only when using the static functions)

Maybe it's returning the font specification in a Mac-specific form that Qgis doesn't understand?

#8 Updated by Tom Elwertowski over 15 years ago

This appears to be a Qt bug. The new native Mac font dialog seems to work (for some fonts) only in 64-bit builds. The workaround is to used the old non-native font dialog for 32-bit builds.

Fixed by 2cb06056 (SVN r11281) (workaround).

#9 Updated by John Tull over 15 years ago

Great work, Tom. This does get around the issue. I agree that it is probably a qt bug, which has been my hunch. I could not find anything about this on their mail lists.

The same problem exists in the map composer. I've attached the two cpp files with the necessary edits. Not sure how to create the patch file.

I was close to finding this workaround today, but gave up. I was unclear on how to call the DoNotUseNativeDialog option and gave up. Glad to see your still keeping an eye on mac-related issues. I will look into qt-64 bit, although I hit some other problems when I tried that a month or so back that I cannot recall now.

#10 Updated by Tom Elwertowski over 15 years ago

Attached map composer fixes submitted as .

#11 Updated by Jürgen Fischer about 15 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Replying to [comment:9 jctull]:

The same problem exists in the map composer. I've attached the two cpp files with the necessary edits. Not sure how to create the patch file.

#12 Updated by William Kyngesburye about 14 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (fixed)

Either it wasn't really fixed, or it's back. Reported in #3105. It goes beyond vectors (maybe this originally did, but noone noticed) -- all layout and map composer font selection seems to be affected.

Now with Qgis 1.5, Qt 4.6 Cocoa, both OSX 10.5 and 10.6.

OSX 10.6 64bit: some fonts work, some fonts snap to another when selected and/or don't display the correct font. I don't see any pattern of kinds of fonts (PS, OTF, TT, Mac) or whether they are loaded directly by the system from standard font folders or from a font manager.

OSX 10.5 32bit: same behavior as this original bug - font is selected in the font dialog, but display doesn't change and font snaps back to Lucida Grande. Though it looks like Qt 4.6 Cocoa now forces the Mac font dialog, whether or not the program asks for it (ie from ).

#13 Updated by William Kyngesburye about 14 years ago

More:

Also happens with trunk, OSX 10.6.

OSX 10.5 PPC Qt 4.6 Carbon: uses Qgis/Qt font dialog and font selection seems to work.

#14 Updated by CK - over 13 years ago

  • Resolution set to worksforme
  • Status changed from Feedback to Closed

Hi,
I had this and other problems after upgrading to Snow Leopard. Problem is now solved following a 'clean install' of SL.
CK

#15 Updated by William Kyngesburye over 13 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (worksforme)

Reinstalling the system is too general, and I've tried it on a clean system.

#16 Updated by William Kyngesburye over 13 years ago

I've been meaning to poke at this, so here's some more test results. I changed the dialog code to force non-native for all Cocoa Qt, then tried some fonts.

- At any time, when a font manager is used (the pro kind that enables fonts in-place instead of copying to standard font folders), Qt ignores the DontUseNativeDialog flag and shows the native font dialog, with all its problems. Otherwise,

- Initially, the Qt font dialog is shown. Font selections don't snap back to other fonts, BUT some fonts still don't work, ie they display as Helvetica.

Once a font is selected and OK'd (back to the map display, but not back to the labeling dialog), one of two things may happen the next time the font dialog is shown:

- If the font selected previously was a working font, the Qt font dialog is shown again,

- If the font selected previously was not working (displays as Helvetica), the native Mac font dialog is shown.

#17 Updated by William Kyngesburye over 13 years ago

Looking into this some more, checking things I should have... There is a Qt bug for 4.6.3 for the problem where it sometimes ignores DontUseNativeDialog. Fixed in 4.7.1.

A couple hits for the selection issue in native dialogs.

One Qt bug seems to be similar, but it's only fixed for Qt 4.8.

Another suggests that if the initial font specified in getFont() is invalid, the dialog always returns the default font, which was the original problem of this Qgis bug report.

I guess I need to look at Qt 4.7 again, I had other issues with that but forgot to write anything down.

#18 Updated by John Tull over 13 years ago

This problem persists on OS X. - bug update for 1.7 release

#19 Updated by William Kyngesburye over 13 years ago

  • Status changed from Feedback to Closed
  • Resolution set to fixed

Verified that the DontUseNativeDialog Qt bug is fixed in 4.7.1, so Qgis can force the Qt font dialog starting with Qt 4.7.1. e4389418 (SVN r15324) forces the Qt font dialog for Qt Cocoa. With Qt 4.5-4.6 it will try, though generally fail, to do so, but that's all it can do.

Font selection is still problematic, though it's also probably a Qt bug. But I think I now have the pattern for what fonts can't be used. Although all fonts can be selected in the Qt font dialog, some display with the default font (ie Helvetica). These include all non-roman OTF fonts, like CJK and symbol fonts. some examples:

  • Hiragino family (system), Japanese
  • Wingdings family (system), symbol
  • any of the CJK OTF fonts bundled with Adobe software

CJK/symbol fonts that work because they're TT or PS fonts:

  • Carta PS
  • Osaka (system), Japanese
  • other CJK TT fonts from the system
  • other language fonts in the system (Cyrillic, ...)
  • ESRI symbol fonts

Closing as fixed, though it's only fixed as far as it can be within QGIS (dialog only for Qt 4.7.1+, font display works within limits).

Also available in: Atom PDF