Ticket #1752 (closed bug: fixed)

Opened 4 years ago

Last modified 2 years ago

Font label settings not working on OS X

Reported by: jctull Owned by: telwertowski
Priority: major: does not work as expected Milestone: Version 1.6.0
Component: Symbology Version: Trunk
Keywords: font label symbology Cc:
Platform Version: 10.5+ Platform: OS X
Must Fix for Release: Yes Awaiting user input: no

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.

Attachments

qgscomposerlegendwidget.cpp Download (9.9 KB) - added by jctull 4 years ago.
qgscomposerlegendwidget.cpp font dialog
qgscomposerlabelwidget.cpp Download (2.6 KB) - added by jctull 4 years ago.
qgscomposerlabelwidget.cpp mac font dialog

Change History

  Changed 4 years ago by kyngchaos

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

  Changed 4 years ago by jctull

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?

  Changed 4 years ago by kyngchaos

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?

  Changed 4 years ago by jctull

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

  Changed 4 years ago by kyngchaos

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

  Changed 4 years ago by jctull

Unfortunately, r11264 did not fix this problem.

  Changed 4 years ago by kyngchaos

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?

  Changed 4 years ago by telwertowski

  • owner changed from nobody to telwertowski

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 r11280 (workaround).

Changed 4 years ago by jctull

qgscomposerlegendwidget.cpp font dialog

follow-up: ↓ 11   Changed 4 years ago by jctull

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.

Changed 4 years ago by jctull

qgscomposerlabelwidget.cpp mac font dialog

  Changed 4 years ago by telwertowski

Attached map composer fixes submitted as r11287.

in reply to: ↑ 9   Changed 4 years ago by jef

  • status changed from new to closed
  • resolution set to fixed

Replying to 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.

svn diff >1752_osx_fontsel_composer.diff

  Changed 3 years ago by kyngchaos

  • status changed from closed to reopened
  • component changed from Vectors to Symbology
  • summary changed from Vector font label settings not sticking on OS X to Font label settings not working on OS X
  • platform_version changed from 10.5.7 to 10.5+
  • milestone changed from Version 1.2.0 to Version 1.6.0
  • keywords symbology added; vector removed
  • resolution fixed deleted

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

  Changed 3 years ago by kyngchaos

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.

  Changed 2 years ago by CK

  • status changed from reopened to closed
  • resolution set to worksforme

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

  Changed 2 years ago by kyngchaos

  • status changed from closed to reopened
  • resolution worksforme deleted

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

  Changed 2 years ago by kyngchaos

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.

  Changed 2 years ago by kyngchaos

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.

  Changed 2 years ago by jctull

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

  Changed 2 years ago by kyngchaos

  • status changed from reopened 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. r15323 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).

Note: See TracTickets for help on using tickets.