hypenation support inside textflow

Asked by Stefan de Konink

I think it was discussed about two years ago on IRC. But I want to know where we stand today. Is it possible (even by inserting soft-hypenated text) to make Inkscape automatically break words upon a flow ending? The feature request would then be to add this hypenations automatically when enabled.

Question information

Language:
English Edit question
Status:
Answered
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
mahfiaz (mahfiaz) said :
#1

Sorry, no hyphenation support. Actually, text support hasn't move forward since then, and there are more important text handling improvement tasks to complete before hyphenation is to be touched.

But feel free to add a blueprint, if you are not feeling like coding it yourself.

Revision history for this message
Stefan de Konink (skinkie) said :
#2

Thanks :) I'll see what I can do. I'm still very in love with the flow support in Inkscape. I'll try to first create soft-hypenation support (for annotated text) with binary search. And then probably allow Inkscape to annotate known words based on a wordlist.

Revision history for this message
Stefan de Konink (skinkie) said :
#3

Thanks mahfiaz, that solved my question.

Revision history for this message
mahfiaz (mahfiaz) said :
#4

Good to hear that, waiting...

Revision history for this message
Stefan de Konink (skinkie) said :
#5

It gets interesting. While I was reading the code I saw soft-hypen support already present in Layout-TNG-Compute.cpp; so I started to test what works and what doesn't. Now it seems it *does* break on annotated input, what it *doesn't* do is add the character! In this case even justification works out of the box :)

As a non-inkscape engineer; is it possible to update the virtual chunks used for displaying, with an hyphenation character?

            if (char_attributes.is_mandatory_break && span->end != span->start) {
                *last_emergency_break_span = *last_break_span = *span;
                if (is_soft_hypen)
                    para.replace(char_count, 1, 1, "-");
                TRACE(("span %d end of para; width = %f chars = %d\n", span->start.iter_span - para.unbroken_spans.begin(), span->width, char_count));
                return false;
            }

I'm going to try the above. If you understand my concept, could you give any feedback?

Revision history for this message
Alexandre Prokoudine (alexandre-prokoudine) said :
#6

Stefan, could you please subscribe to inkscape-devel@ and discuss this? ;-) Thanks!

Revision history for this message
mahfiaz (mahfiaz) said :
#7

I am no developer, cannot help you. Could you ask it on <email address hidden> ? Or discuss on #inkscape.

Can you help with this problem?

Provide an answer of your own, or ask Stefan de Konink for more information if necessary.

To post a message you must log in.