NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

How can I force (or prevent) a line break, because the place name (!Khoro !Goreb Conservancy) should not break after (only before) the second exclamation mark? (It is Khoisan language and therefore the correct spelling must be shown.) Thank you!

Edit: Is there a way to insert a no-break space in the name, in the specific case between "!Khoro" and "!Goreb", so that no line break is displayed in an unwanted place?

asked 16 Jul '22, 23:56

otji73's gravatar image

otji73
41115
accept rate: 0%

edited 17 Jul '22, 10:25


The presentation of the data is up to each individual renderer and is not something under the direct control of the mapper.

There are lots of different projects rendering OSM data into maps and you don’t say which map you see the word wrap error on. I will guess that it is the carto version shown on the OSM main page. I believe there is a GitHub repository and project for that where you can file a bug report.

permanent link

answered 17 Jul '22, 00:08

n76's gravatar image

n76
10.8k1082172
accept rate: 17%

1

Thank you for your answer!

I don't see it as a bug to report for now, and yes, I mean the map view in the OSM main page.

Maybe I can rephrase my question: is there a way to insert a no-break space ( https://en.wikipedia.org/wiki/Non-breaking_space ) in the name, in the specific case between "!Khoro" and "!Goreb", so that there is no line break in an unwanted place?

(17 Jul '22, 10:20) otji73
1

As far as I can tell, OSM data fields are all Unicode with very little interpretation. So if you know how to type a non-breaking space on your computer it will probably work.

It would still be a good idea to try to raise this issue with the rendering team as it seems likely that other names in that area will have the same issue and the rendering should be aware of the language.

It would also be a good idea to have the Khoisan name tag on the object too.

Hmmm. Wikipedia says Khoisan is actually a family of languages not all of which are genealogically related. So I guess you would need the code for the specific language using the "name:language=whatever" tagging see: https://wiki.openstreetmap.org/wiki/Key:name#Variants With this the render can have enough information to determine the language the main "name=whatever" tag is in so it can do special processing. If only the name=* tag is there it is almost impossible for a computer to 100% identify what the language is in all cases.

(17 Jul '22, 15:59) n76

I suspect there is a simpler case which is to treat "!" at the start of a word as a character not punctuation. The Mapnik text symbolizer's rebric says it breaks on spaces, which does not seem to be consistent with this problem. Perhaps the best approach in Carto would be to do something using LUA. An interesting problem.

(17 Jul '22, 16:33) SK53 ♦

n76 wrote: As far as I can tell, OSM data fields are all Unicode with very little interpretation. So if you know how to type a non-breaking space on your computer it will probably work.

Thank you, this is a simple and elegant solution. I added a non-breaking space in Unicode between the two words and - in a few hours or days when the map is re-rendered - we will see if it works. I will document it here then.

permanent link

answered 17 Jul '22, 18:16

otji73's gravatar image

otji73
41115
accept rate: 0%

The first attempt showed that it was not enough to insert a non-breaking space in Unicode.

(25 Jul '22, 14:17) otji73

The first attempt showed that it was not enough to insert a non-breaking space in Unicode.

You won't be able to test this by editing a name and waiting for it to change at OpenStreetMap.org - there is simply too much caching involved that you have no control over involved.

I think you'll need to set up your own renderer, or ask someone to help you do that, and then experiment with names there. Links that might help include here and here.

(25 Jul '22, 15:37) SomeoneElse ♦

SK53 wrote: I suspect there is a simpler case which is to treat "!" at the start of a word as a character not punctuation. The Mapnik text symbolizer's rebric says it breaks on spaces, which does not seem to be consistent with this problem.

I'll try it now with Unicode additionally for the "exclamation marks" (U+01C3 latin letter retroflex click/0451) and can report the result in a few days.

alt text

(Figure from Wikipedia)

SK53 wrote: Perhaps the best approach in Carto would be to do something using LUA.

Unfortunately, I don't know what is meant by 'Carto' and 'LUA'.

permanent link

answered 25 Jul '22, 14:23

otji73's gravatar image

otji73
41115
accept rate: 0%

edited 25 Jul '22, 14:34

2

Simplified explanation: LUA is a language used in one of the tools that processes the OSM data as it is put into a SQL database with geographic extensions. WIth LUA you can do a lot of transformations and decision making about the OSM data. The SQL database is then used for the actual rendering (drawing) of the map you see at www.openstreetmap.org and the rules for rendering are called carto.

If SK53 is successful then it should be possible to render (draw) names using the click sound characters correctly and the work around of using a nonbreaking space will not be needed.

(25 Jul '22, 15:03) n76

Yes, that worked: click sounds and non-breaking space were entered via Unicode.

In the specific case:

<u+01c3>Khoro<u+00a0><u+01c3>Goreb Conservancy

To be on the safe side, the non-breaking space was also entered per Unicode. ;-)

Thanks to all of you for your help!!!

(02 Aug '22, 21:40) otji73
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×31
×9
×3
×1

question asked: 16 Jul '22, 23:56

question was seen: 1,110 times

last updated: 02 Aug '22, 21:41

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum