Font style errors / assert when changing style

Bug #181663 reported by Vaughn Iverson
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
theAdib

Bug Description

Hi,

A legend I created in Inkscape 0.45.1 with italic text loads in 0.46dev+devel (Win32 build, Jan 9 2008) without the italic font style.
If the text is selected and an attempt is made to change the font style to italic, Inkscape crashes with this assert:

** Error **: file src/libnrtype/FontFactory.cpp line 499 (Glib::ustring font_factory::FontSpecificationSetItalic(const Glib::ustring&,bool)); assertion failed: (it != fontInstanceMap.end()) aborting... <OK>

To Reproduce (using sample file attached to this bug report):

1) Verify that this functionality works in 0.45.1. Load file and note the italic text style in all but the top and bottom rows of text in the legend.

2) Load the same file in 0.46dev+devel (I used win32 build: Inkscape0801092138)

3) Note that none of the lines of text are italic.

4) Change to the text tool, and click on one of the middle lines of text (e.g. "Rhizobiales")

5) Use <Ctrl>-A to select the entire text element

6) Using the mouse, click the 'italic A' button in the second line of the toolbar.

7) Inkscape should assert at this point.

Note: If you instead attempt to makethe text italic by using <Ctrl>-I with the text selected in the text tool, there is no assert, but Inkscape fails to make the text style Italic as one would expect.

Thanks! -Vaughn

Revision history for this message
Vaughn Iverson (vsi) wrote :

Here is the file to reproduce...

Revision history for this message
bbyak (buliabyak) wrote :

On linux, rev 17009, there's no crash/assert and labels are italic.

HOWEVER: selecting text in one label and pressing the italic button does nothing. button does not unpress and text does not change. Same behavior in a new document, buttons seem broken. Setting style via the text&font dialog works fine.

Changed in inkscape:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Tom Davidson (tjd-mit) wrote :

Note the bold button works to set text to bold, but hitting it again does not 'unbold' the text. (SVN rev 16978)

Revision history for this message
Tom Davidson (tjd-mit) wrote :

As an aside: setting the font size using the text toolbar is also deeply borked, see bug 168397

Revision history for this message
Gail (gbanaszk) wrote :

I'll look at this today, hopefully "relatively easy" to fix. WiIll let you know when I'm done for retesting.

Changed in inkscape:
assignee: nobody → gbanaszk
Revision history for this message
Gail (gbanaszk) wrote :

- I didn't see the problem described in the main part, but the assert was overzealous and, in my new opinion, shouldn't be there, so it's gone.
- Fixed other style button problems mentioned in comments.

Fix checked into SVN, please give it a try and see if there are any other issues.

Revision history for this message
Gail (gbanaszk) wrote :

Regarding Tom's aside, text size is not related to the problem with this bug (which had to do with my latest patch).

Tom Davidson (tjd-mit)
Changed in inkscape:
status: Confirmed → In Progress
Revision history for this message
bbyak (buliabyak) wrote :

fixed in svn, thanks Gail

Changed in inkscape:
status: In Progress → Fix Released
Revision history for this message
Tom Davidson (tjd-mit) wrote :

Actually, in SVN 17013, the Bold button now works, but the Italic button still does nothing with text selected. Ctrl-I does set the font format (and update the button).

Changed in inkscape:
status: Fix Released → In Progress
Revision history for this message
theAdib (theadib) wrote :

I attach a patch that address following things:
- the FontSpecificationSetItalic function only checked for italic font styles but not on oblique so it fails on Verdana Sans (that has Oblique style)
- similar effect in Ctrl-I when testing to == STYLE_NORMAL now testing to != STYLE_NORMAL and then applying =STYLE_NORMAL otherwise =STYLE_ITALIC (ITALIC is also evaluated in pango for OBLIQUE)
- in case of deactivating the italic parameter and having following css style "font-style:italic;-inkscape-font-specification:Bitstream Vera Sans" then the resulting font is "Bitstream Vera Sans" . The former code ignored cases where the resulting font is equal the present font. (this was the return code in FontSpecificationSetItalic in case of font_not_found). Now return value is an empty string an can easily evaluated.
- in case there is a font not having those attributes the code will put the buttons to the previous value.

As usual pls test, review and commit ;-)

Adib.
---
pls ignore the white spaces in the patch

theAdib (theadib)
Changed in inkscape:
assignee: Gail (gbanaszk) → theAdib (theadib)
Revision history for this message
su_v (suv-lp) wrote :

Testing your patch with Inkscape r22275 on OS X 10.5.8

Quick first impression (I am not a font expert): 'italic' on the font tool controls bar works more often 'as expected' then before ;)
i.e. doesn't work correctly for OS X font formats (DFONT = Datafork TrueType font, Font Suitcase), but fine for TTF and OTF fonts.

tags: added: fonts ui-dialogs-toolbars
Revision history for this message
ScislaC (scislac) wrote :

suv,

I think that the proper thing to do is for us to apply the patch (it needs a tiny fix first) and then close this bug. Following that, a new bug should be opened which addresses the OSX specific font issues.

Another thing that will need to be implemented (if not already) is "faux" styling for when bold or italic versions of fonts do not exist. Either way, we're going to have to cover some territory that apparently Quark had issues with too.

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

@ScislaC - I didn't mean to imply the patch doesn't work. I'm aware about the (pango related?) issues on OSX (and of existing workarounds as detailed in the FAQ), and AFAIR there are already reports filed about specific font issues on OS X. For other fonts this patch is working and certainly a highly appreciated fix!

theAdib (theadib)
Changed in inkscape:
milestone: none → 0.47
Revision history for this message
theAdib (theadib) wrote :

attached the patch including the false positive "bold" button correction.
The patch replaces the former one.
Adib.

Revision history for this message
ScislaC (scislac) wrote :

Committed in r22285... theAdib, you are officially a rock star!

Changed in inkscape:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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