Bad text wrapping of names

Started by karlchick, March 11, 2023, 10:17:22

0 Members and 1 Guest are viewing this topic.

karlchick

Since the new releases of Locus Map 4.15.1 and Locus Classic 3.66.1, both editions are now text wrapping "long" names.

For really long names this is good, but the algorithm is going g a poor job of wrapping also not very long names. Also the wrapping seems to be left justified, and the placement of symbols "below" are not to the bottom/right.

Seems to be only v4 maps affected.

In the past this would occur rare and then stop, e.g. if change maps or restart. But, I've tried restarting and it seems be permanent now.

Attached is an example.

Worst is the Nottingham Hill. Having a single character word wrapped also looks bad.

Can the text wrapping be made a setting? Or improved to of wrap on non-alpha chars?
User id: 62b600722
Author of the OS Map Theme:
DiscussDownload

Tapio

Oh yes, I noticed that too. It loves to wrap one last letter...

Berli
n
Tapiola MFV4+ theme for OAM Maps:
Discuss - Releases - DL latest - Install latest
  •  

michaelbechtold

Question: as LoMaps are going to be MapsForge 4+, they would use the same engine as e.g. OAM, right?
Yet, OAM, does not suffer from this effect.
On the other hand, the font sizes of these run-away texts are extreme. Font sizes, however, are defined in the theme XML.
  •  

Tapio

#3
OAM does suffer from the effect. Screenshot is Germany/NRW OAM with VolUK theme.
Tapiola MFV4+ theme for OAM Maps:
Discuss - Releases - DL latest - Install latest

T-mo

Recognised this with 4.14.2.4 or .3, but was not able to compare this to past releases as it was with any vector-map and theme.
  •  

michaelbechtold

Quote from: Tapio on March 11, 2023, 15:49:37OAM does suffer from the effect. Screenshot is Germany/NRW OAM with VolUK theme.

Seems I checked in the wrong places :-)
  •  

Menion

#6
Yes, engines for LoMaps and OAM will be the same. And current Locus Map has already a highly enhanced MapsForge library version. I'll inform @voldapet about this, because we were playing with word wrap and ...
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  
    The following users thanked this post: karlchick

voldapet

@karlchick - as @Menion mentioned we prepared a new attribute `text-wrap-width` that can be used to control the length of text. MF already had an internal system for wrapping long text, and we enabled the parameterization of this internal system and allowed changing the value based on the mentioned attribute. Anyway, the default length (for wrapping) would remain the same.
So the text is wrapped differently than it was before? ( even without using the `text-wrap-width` attribute?)

QuoteAlso the wrapping seems to be left justified,
I think we could improve it and add an attribute to set text-align

QuoteThe placement of symbols "below" are not to the bottom/right.
I'm sorry I haven't noticed it but I'll check it

QuoteBerli
n
That's ugly and it'll be probably complicated to improve it. But MF must have had this problem before the latest changes.




  •  

LocusUser#1

Quote from: voldapet on March 13, 2023, 09:48:34So the text is wrapped differently than it was before? ( even without using the `text-wrap-width` attribute?)
This is precisely the problem. I think that the modification of Locus does not set the default value correctly if no text-wrap-width attribute is used in the theme.
  •  

Menion

Ah got it. Problematic wrapping in the latest app version was found & fixed, thanks!
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download

karlchick

Sounds like the main issue is now fixed... big thanks!

Also sounds like there are some new tags available to theme creators to control text:
- 'text-wrap-width'
- 'text-align'

Are these available now? What is the syntax? I couldn't find them on the doc page.

What happens if I use these in my theme, and then a user with an older version of LocusMap tries to use the latest theme? will it cause a error loading the theme?
User id: 62b600722
Author of the OS Map Theme:
DiscussDownload
  •  

voldapet

@karlchick
'text-wrap-width' - is supported in the latest LocusMap version. There are other useful attributes - please see the latest changes at https://github.com/mapsforge/mapsforge/blob/master/docs/Changelog.md All these attributes are supported in the latest Locus Map. and they will be integrated into the official mapsforge lib when the new MF release is published.
'text-align' - such an attribute doesn't exist yet but I think we could focus on it and prepare support for it.

The document page is basically out of date. Earlier LoMaps (V3) were rendered by our own rendering program with all these special directives. But the next generation of LoMaps will be generated as MF V4 version and will use the official MF renderer. For this reason, also V4 theme is required for the next generation of LoMaps.

User with older version of LoMaps (V3) can select only old V3 theme.
  •  

Menion

So update ...

The "text-align" parameter is not necessary as it is already included in the "position" parameter. There is just a small issue that was just fixed and if confirmed, will be in the next version as well.

How "position" works together with wrapping may be visible in the new pull-request here.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download

karlchick

Quote from: voldapet on March 14, 2023, 10:05:41@karlchick
please see the latest changes at https://github.com/mapsforge/mapsforge/blob/master/docs/Changelog.md

Looks like we're getting the curved contours back, yay!

Very much appreciate the improvements you are all making to mapsforge.
User id: 62b600722
Author of the OS Map Theme:
DiscussDownload
  •  

michaelbechtold

Quote from: Menion on March 14, 2023, 12:50:09...
How "position" works together with wrapping may be visible in the new pull-request here.
@Menion: I suspect you are employing the Android high quality text break feature now; right?
  •