Add font variant drop-down box to new text toolbar

Bug #575831 reported by Vladimir Savic
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
John Smith

Bug Description

Professional font usually have more then just bold and italic variants. Using text dialog just for that purpose is starting to be painful. Given that we already have such a great toolbar, that is.

Tags: text ui
su_v (suv-lp)
tags: added: text ui
Changed in inkscape:
importance: Undecided → Wishlist
Revision history for this message
John Smith (john-smithi) wrote :

Patch to add a font style dropdown list to the text toolbar.

Should match the text dialog styles and behavior.
Bold/Italic buttons are left in place for comparison, would remove these.

The dropdown is "editable" - similar to the font family and size, but could be changed to a true dropdown list (list the units on the measure toolbar).

Changed in inkscape:
assignee: nobody → John Smith (john-smithi)
status: New → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

Tested on Windows XP, Inkscape revision 11575.

Works as expected, except that the new dropdown is initialized blank.

Note that the console is polluted by lots of messages that seems to be unrelated to your patch but make it a bit difficult to debug.

Revision history for this message
John Smith (john-smithi) wrote :

Committed to trunk as r11586.

Dropdown should be initialized properly
Bold and Oblique buttons removed from toolbar

Changed in inkscape:
status: In Progress → Fix Committed
su_v (suv-lp)
Changed in inkscape:
milestone: none → 0.49
Revision history for this message
su_v (suv-lp) wrote :

Minor issue in current trunk (critical warnings from pango):

With current trunk >= r11586, Inkscape produces repeatedly console warnings from pango when manipulating text objects using certain fonts (depends on the font name):

(inkscape:49797): Pango-CRITICAL **: void pango_font_description_unset_fields(PangoFontDescription *, PangoFontMask): assertion `desc != NULL' failed

Steps to reproduce:
1) install font 'Lobster' from <http://www.impallari.com/lobster>
   file name: 'Lobster 1.4.otf'
2) launch inkscape
3) create a text, assign font 'Lobster 1.4'
4) switch to the select tool and select the text object

-> console warnings (see above), full backtrace with r11598 attached.

Additional notes:
Independent of the new console warnings from pango (or possibly this is the underlying problem): Inkscape internally seems to fail to properly handle the font name 'Lobster 1.4' (in stable and trunk):
- the message of the select tool in the status bar drops the ' 1.4' from the font name
- with the original patch from bug #168658 [1] still in, Inkscape also produces this warning when using the 'Lobster 1.4' font:
** (inkscape:49797): WARNING **: Failed to load font 'Lobster' substituted with 'DejaVu Sans'.
though the text on-canvas is rendered correctly using the chosen font.
- fontforge reports some inconsistencies with regard to font name for 'Lobster 1.4.otf' (possibly not really an inkscape problem but a ambiguous setting in the font file itself (?))

---
[1] <https://launchpadlibrarian.net/87287337/168658.patch>

Revision history for this message
su_v (suv-lp) wrote :

> With current trunk >= r11586, Inkscape produces repeatedly console
> warnings from pango when manipulating text objects using certain
> fonts (depends on the font name):
>
> (inkscape:49797): Pango-CRITICAL **: void pango_font_description_unset_fields(PangoFontDescription *, PangoFontMask): assertion `desc != NULL' failed

Also happens with standard fonts like for example 'Times New Roman' -> warning does not seem to occur due to errors in the font files themselves.

Revision history for this message
John Smith (john-smithi) wrote :

Well that Lobster is a lovely font, but ...
cannot reproduce with Ubuntu, Gnome or Windows 7 using the text toolbar or text dialog.
I also dont see any problems with the "Lobster 1.4" name in the toolbar or dialog.
Let me check where pango_font_description_unset_fields is beng called ...

Revision history for this message
Vladimir Savic (vladimir-firefly-savic) wrote :

I can't change font variant using drop-down menu at all. This is with Inkscape 0.48+devel r11616. Every variant is listed correctly, but no matter what I select it always drops to one I've started writing with, or the first one present if I change font itself (again by using dropdown).

There are a lot of (inkscape:8235): Pango-CRITICAL **: pango_font_description_unset_fields: assertion `desc != NULL' failed messages in terminal, but I don't have slightest idea if that is related.

Revision history for this message
ScislaC (scislac) wrote :

@Vladimir: Open inkscape and try to reproduce. If you can reproduce, try to change it in the Text & Font dialog instead and see if it works there. I had the same issue, but it seemed rather random so I was unable to give useful feedback.

Revision history for this message
Vladimir Savic (vladimir-firefly-savic) wrote :

Funny it works if I set default font to Times New Roman and type random characters on canvas. It didn't work with Bickham Script Pro from Adobe. Where it completely fails is combined text. If I combine Times and Verdana, for example, and select chars belonging to both fonts, changing variant fails, even though both fonts support Bold variant.

Revision history for this message
John Smith (john-smithi) wrote :

@Vladimir, thanks for your testing.
Yes there was an issue when "combined" text (with more that one font) was selected.
The font variant was not working then, this should be fixed (r11617) now.

Revision history for this message
John Smith (john-smithi) wrote :

@suv, as above there was an issue with the font variant with certain text selections, cursor positions that should be fixed.
pango_font_description_unset_fields gets called when the font variant is trying to find the best variant for the current selection. Can you try with version >= r11617 and see if you still get those issues ?

Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.