New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msLayoutTextSymbol replaces WRAP char unconditionaly with SPACE #5612

Closed
olt opened this Issue Jun 15, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@olt
Contributor

olt commented Jun 15, 2018

The "new" msLayoutTextSymbol function replaces all occurences of the WRAP character with a SPACE character and then wraps labels at these characters if they are longer then MAXLENGTH. For example, if you use WRAP '-' the label My-label-with-dash is rendered as My label with dash even if the label is not wrapped.

This appears to be a regression with MapServer 7. (/cc @tbonfort)

Is there a reason for this behavior? My understanding is that we can remove:

mapserver/textlayout.c

Lines 534 to 540 in 2b9d022

if(ts->label->wrap != ' '){
for(i=0;i<num_glyphs;i++) {
/* replace all occurences of the wrap character with a space */
if(glyphs.unicodes[i]== ts->label->wrap)
glyphs.unicodes[i]= ' ';
}
}

and replace the checks for ' ' with ts->label->wrap at these positions:

if(glyphs.unicodes[i]== ' ')

if(glyphs.unicodes[i]== ' ' && num_cur_glyph_on_line >= ts->label->maxlength) {

I can provide a patch, but please consider my follow up issue.

@olt

This comment has been minimized.

Contributor

olt commented Jul 31, 2018

There is a fix in #5634.

@sdlime sdlime closed this in #5634 Aug 30, 2018

sdlime added a commit that referenced this issue Aug 30, 2018

Merge pull request #5634 from olt/label-wrap-fix
Fix label wrap (#5612) and wrap at ZERO WIDTH SPACE (#5613)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment