Locus Map - forum

Support => Troubles & Questions => Topic started by: karlchick on March 11, 2023, 10:17:22

Title: Bad text wrapping of names
Post by: karlchick on March 11, 2023, 10:17:22
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?
Title: Re: Bad text wrapping of names
Post by: Tapio on March 11, 2023, 10:42:42
Oh yes, I noticed that too. It loves to wrap one last letter...

Berli
n
Title: Re: Bad text wrapping of names
Post by: michaelbechtold on March 11, 2023, 15:46:41
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.
Title: Re: Bad text wrapping of names
Post by: Tapio on March 11, 2023, 15:49:37
OAM does suffer from the effect. Screenshot is Germany/NRW OAM with VolUK theme.
Title: Re: Bad text wrapping of names
Post by: T-mo on March 11, 2023, 20:01:22
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.
Title: Re: Bad text wrapping of names
Post by: michaelbechtold on March 12, 2023, 15:45:00
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 :-)
Title: Re: Bad text wrapping of names
Post by: Menion on March 13, 2023, 08:05:13
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 ...
Title: Re: Bad text wrapping of names
Post by: voldapet on March 13, 2023, 09:48:34
@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.




Title: Re: Bad text wrapping of names
Post by: LocusUser#1 on March 13, 2023, 11:15:03
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.
Title: Re: Bad text wrapping of names
Post by: Menion on March 13, 2023, 15:05:03
Ah got it. Problematic wrapping in the latest app version was found & fixed, thanks!
Title: Re: Bad text wrapping of names
Post by: karlchick on March 13, 2023, 18:00:08
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 (https://docs.locusmap.eu/doku.php?id=manual:advanced:map_tools:theming#supported_tags).

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?
Title: Re: Bad text wrapping of names
Post by: voldapet on March 14, 2023, 10:05:41
@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.
Title: Re: Bad text wrapping of names
Post by: Menion on March 14, 2023, 12:50:09
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 (https://github.com/mapsforge/mapsforge/pull/1395).
Title: Re: Bad text wrapping of names
Post by: karlchick on March 14, 2023, 19:13:42
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.
Title: Re: Bad text wrapping of names
Post by: michaelbechtold on March 15, 2023, 10:55:58
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 (https://github.com/mapsforge/mapsforge/pull/1395).
@Menion: I suspect you are employing the Android high quality text break feature now; right?
Title: Re: Bad text wrapping of names
Post by: Menion on March 15, 2023, 14:17:28
Right. We've tested it quickly with Petr and had positive results.
Title: Re: Bad text wrapping of names
Post by: Gerhard57 on April 28, 2023, 11:15:32
The text wrapping error seems to be back.
LM4 4.16.0
Locus map V4 test germany nordrhein-westfalen from 23.03.2023
bad_text_wrap.png
Title: Re: Bad text wrapping of names
Post by: voldapet on May 02, 2023, 16:38:23
@Gerhard57
I'm sorry I can't simulate it. Do I understand correctly that you have already tested this in a previous version? with the same device? As I remember, it's possible that maybe in some situations the label is incorrectly wrapped, but it shouldn't happen for every city like in your screenshot.  :-\
Title: Re: Bad text wrapping of names
Post by: Gerhard57 on May 02, 2023, 17:45:40
@voldapet
you are right. I tested 2 devices now. Same LM Version (4.16.0) same Lomaps V4 file from google dive directory (23.03.2023) internal theme. Both with same error.
Before i testet only on one device (SAMSUNG Galaxy TAB S2 with Android 7.0) with LM 4.15.* and Lomaps V4 from 20.02.2023 -> Error. Last Beta Version 4.15.2 fixed it.

UPDATE:
any idea?
Title: Re: Bad text wrapping of names
Post by: Gerhard57 on May 03, 2023, 10:11:21
@voldapet
Cause of error found :)
Settings -> Maps -> Offline maps -> Text size 150% instead of 100%

I think text-wrap-width does't take notice of this test size faktor
Title: Re: Bad text wrapping of names
Post by: voldapet on May 03, 2023, 10:29:42
@Gerhard57
I see thank you for the info. Well the width of the text is increased when changing the scale for text. I'll discuss it with @Menion but I'm not sure if we can improve it.
Title: Re: Bad text wrapping of names
Post by: Gerhard57 on June 02, 2023, 20:41:19
still bad text wrapping in LM 4.17.1.2 even if Settings -> Maps -> Offline maps -> Text size 100%