text font (imported from pdf) not shown in status line and font selection dialogue

Bug #1046170 reported by wilfriedh
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Triaged
Low
Unassigned

Bug Description

Open the attached pdf in Inkscape.

In Inkscape 0.48.3.1 r9886 (stable release) the font selection dialogue shows "Sans" selected for all texts, and all text is displayed in "Sans".
When a text is selected, the status line sais "Text (Sans, ..."
The font information is correctly included when saving to svg.

In nightly build r11604 (2012-08-13, latest available on skydrive.live.com) the font selection dialogue shows NO font, NO font style and NO font size, however the text is displayed in the correct font.
When a text is selected, the status line sais "Text (<no name found>, ..."
The font information is correctly included when saving to svg.

Revision history for this message
wilfriedh (w-hennings) wrote :
Revision history for this message
wilfriedh (w-hennings) wrote :

The effect does NOT occur when I import this emf (created by Powerpoint) to Inkscape.

summary: - text font not shown in status line and font selection dialogue
+ text font (imported from pdf) not shown in status line and font
+ selection dialogue
Revision history for this message
Alvin Penner (apenner) wrote :

missing font information in status bar at bottom and in Text and Font dialog is confirmed on Windows XP, Inkscape rev 11643.
This can be reproduced from scratch by performing a round-trip from svg to pdf and back to svg.
attached is an svg file with two fonts in it.

Revision history for this message
Alvin Penner (apenner) wrote :

save this as pdf to get the attached file.
Then load the pdf, ungroup the group and note that the font names do not show up as expected, even though they are present in the imported file. The font information is contained in the <tspan> tag instead of the normal <text> tag.

Changed in inkscape:
status: New → Confirmed
jazzynico (jazzynico)
tags: added: regression text ui
tags: added: fonts
Revision history for this message
Alvin Penner (apenner) wrote :

this may be a duplicate of Bug 219709, see comment 3 in that report

Revision history for this message
Alvin Penner (apenner) wrote :

- a fix has been committed to bzr rev 11661. The style attribute has been moved from the <tspan> node to the <text> node.
 - the result is that the font family is now displayed in the status line at the bottom.
 - I am not sure if this addresses all the issues raised in this report, could you re-test and see if the problem is fixed?

Revision history for this message
wilfriedh (w-hennings) wrote :

Thank you for fixing.
However I can only test after the fix made its way into the windows nightly build.
I'll be back when I have tested.

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

<possibly off-topic>

> - a fix has been committed to bzr rev 11661.

Personally, I have no idea how safe this assumption is because I don't know any details of how the PDF importer works for text:
      // assume all <tspan> nodes in a <text> node share the same style
Does the PDF import routine always enforce the creation of separate text objects if a style attribute (e.g. bold/normal) changes within a contiguous text?

> - the result is that the font family is now displayed in the status
> line at the bottom.
> - I am not sure if this addresses all the issues raised in this report

It does not address the underlying issue of the select tool messages as far as I understand it. You can reproduce a similar - at first sight inconsistent - message of the select tool for selected text in Inkscape itself (without importing or round-trip-editing a PDF file with text), for example by changing the font family of a regular text object by explicitly highlighting all content and choosing a different font family for the highlighted text. This will result in the select tool reporting a different font family in the status bar than shown in the text tool controls bar when selecting the text with the text tool cursor (the text tool controls bar shows the correct style of the current <tspan>, whereas the select tool apparently only considers the style attribute of the parent <text> element.

It seems to me that either
a) the select tool each time ought to check whether any <tspan> object inside the selected <text> object has a different font style set than the parent <text> object, and adjusts the message accordingly (if none of (possibly nested) <tspan> objects overrides an inherited style attribute, report the style of the parent <text> object; if all <tspan> elements result using an identical computed style (family, size, style, …), and it differs from the style of the parent <text> object, report the computed style; else report something like "various font styles used".
or
b) it is considered ok that the message in the status bar always reports the style assigned to the parent <text> object, including 'None' if no 'style' attribute is present on that level (which makes sense considering that within the <text> container, there can be an unlimited number of different style attributes added to various (nested) <tspan> elements, making use of style inheritance rules while overriding individual properties).
or
c) a mix of a and b: only report the style of the <tspan> children instead of the parent <text> object if they all use an identical style (also applies if the parent has no 'style' attribute itself). For text objects containing multiple <tspan> elements with various different style properties, always report the style of the parent <text>.

</possibly off-topic>

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

<possibly off-topic> cont.

The regression with the 'Text and Font' dialog in current trunk (failing for selected text (select tool context) with missing top-level style attribute) is similar to the one with the messages of the select tool in the status bar, but probably needs a different fix. It can also be reproduced within Inkscape e.g. with the text generated by the extension 'Extensions > Text > Lorem Ipsum' for which the 'Text and Font' dialog fails to update the information displayed in the dialog (values from a regularly styled text selected prior to the generated text remain in the dialog (including the preview text), no longer matching the actually selected text).

This probably should be reported as follow-up to bug #932048.

</possibly off-topic>

Revision history for this message
wilfriedh (w-hennings) wrote :

Tested with r11664.

If a text is selected, the correct font is displayed in the status line.

BUT

In the pdf created by Adobe Illustrator,
in the font selection dialogue, "Sans" is preselected for any text which is in Arial, Helvetica or a font not available in my machine.

In the pdf exported from Inkscape (attached file Fonttest.svg),
texts in Arial are displayed correctly,
a text in TimesNewRoman standard (exported to pdf as TimesNewRomanPSMT) is displayed correctly
but TimesNewRoman italic or bold is displayed in a Sans font.

For symbols in Wingdings3 font, "Wingdings3" is correctly selected but the symbol is not displayed correctly.

Revision history for this message
Alvin Penner (apenner) wrote :

>> For symbols in Wingdings3 font, "Wingdings3" is correctly selected but the symbol is not displayed correctly.

do you mean incorrectly displayed on the main screen, or in the Text and Font dialog?

Revision history for this message
wilfriedh (w-hennings) wrote :

>> For symbols in Wingdings3 font, "Wingdings3" is correctly selected but the symbol is not displayed correctly.

> do you mean incorrectly displayed on the main screen, or in the Text and Font dialog?

The font name (Wingdings3), style (normal) and size 812) are correctly displayed in the status line and correctly preselected in the font selection dialogue, but the symbol itself is displayed as a "?" on the main screen.

Try with attached pd.

Revision history for this message
Alvin Penner (apenner) wrote :

yes, it appears that there is a problem with 'Wingdings 3' and 'Wingdings 2' fonts. I was able to successfully create the right arrow symbol using {} and the Wingdings 3 font in the gui, but when importing from a pdf file this particular font is getting misinterpreted. I believe this is (yet another) distinct bug, separate from the original bug report.

Revision history for this message
jazzynico (jazzynico) wrote :

Tested again on Windows XP, Inkscape trunk revision 12836, with the test file from comment #14.

- The status bar shows the correct fonts.
- The Windings3 symbols is not correctly displayed (?).
- The Font selection dialog is set to sans-serif, whatever is selected on canvas.
- When clicking on text spans, the console shows the following warnings:
----
** (inkscape.exe:3904): WARNING **: Couldn't find row for font-family: ArialMT
** (inkscape.exe:3904): WARNING **: Couldn't find row for font-family: Arial-ItalicMT
** (inkscape.exe:3904): WARNING **: Couldn't find row for font-family: Arial-BoldMT
** (inkscape.exe:3904): WARNING **: Couldn't find row for font-family: TimesNewRomanPSMT
** (inkscape.exe:3904): WARNING **: Couldn't find row for font-family: TimesNewRomanPS-ItalicMT
....

Changed in inkscape:
status: Confirmed → Triaged
Revision history for this message
jazzynico (jazzynico) wrote :

Additional notes:
- If you create another text with a different font, then selecting the Imported PDF with the selection tool doesn't select anything in the font selection dialog.
- If you select the imported text with the Text tool, the Font selection dialog works as expected (correct font selected, crossed if it doesn't exist on the system).

Since the Wingdings issue also exists in 0.48, I'd say the remaining regression is when an imported font is selected with the selection tool.

Revision history for this message
jazzynico (jazzynico) wrote :

More on the console messages.

The text that triggers ***WARNING **: Couldn't find row for font-family: ArialMT*** has two different attributes:
1. -inkscape-font-specification:ArialMT
2. font-family:Arial

The selection tool seems to compare the -inkscape-font-specification with the font list, which could explain the message and the font list error.

jazzynico (jazzynico)
Changed in inkscape:
importance: Undecided → Low
milestone: none → 0.49
Revision history for this message
jazzynico (jazzynico) wrote :

Wingdings issue already reported in Bug #965463 "PDF import, text import issues".

Revision history for this message
jazzynico (jazzynico) wrote :

Some findings:
1. Create a new document with a text in Arial. The SVG code shows the following attributes:
    font-weight:bold;
    font-family:DejaVu Sans;
    -inkscape-font-specification:'DejaVu Sans, Bold';
2. Now save it as PDF and open the PDF. The SVG code now shows:
    font-weight:bold;
    font-family:DejaVu Sans;
    -inkscape-font-specification:DejaVuSans-Bold
3. Open the PDF file with a PDF viewer (tested with Evince). The embedded font name is DejaVuSans-Bold.

Workaround: in the imported document, open the XML editor and remove the -inkscape-font-specification attribute manually.

Revision history for this message
jazzynico (jazzynico) wrote :

2.1 Open the XML editor and select the text element -> the font lister fails.
2.2 Select the span element directly -> the font is correctly selected in the list.

su_v (suv-lp)
Changed in inkscape:
milestone: 0.91 → 0.92
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.