Merge: gamnit: scale text, add custom characters and create links with `BMFont`
authorJean Privat <jean@pryen.org>
Tue, 18 Jul 2017 12:38:09 +0000 (08:38 -0400)
committerJean Privat <jean@pryen.org>
Tue, 18 Jul 2017 12:38:09 +0000 (08:38 -0400)
commit10463758c329cda58809ce75d6f6427ef9825c81
tree9380b3cb7f27ad77fbe89a0b50e9ae727aa34df8
parent7b06f73da75107a452a57f346a81142b2d915247
parent017b3b9050077864ccb895b6ed1388d37e159188
Merge: gamnit: scale text, add custom characters and create links with `BMFont`

This PR adds more customization options when drawing text using `BMFont`:

* Change the size of the text with a simple attribute `TextSprites::scale`.
* Insert artificial chars to a `BMFont` using the more permissive `BMFontChar`. This way, one can set custom textures for a letter, an emojis or any character from the private use areas.
* Add "links" to the text using Markdown-like syntax (`[my link]` or `[pretty name](internal name)`). Note that the links are not clickable by themselves. However, the client code can access the sprites representing the link to change their style or to get their position. This will work well with a rumored future feature making sprites clickable...

Notice the colored links and the smaller text box in the following screenshot of `fonts_showcase`:
![screenshot from 2017-07-13 22-09-20](https://user-images.githubusercontent.com/208057/28196740-8f8630b6-6820-11e7-8915-1df02b4edee5.png)

---

Once again, these new features are not implemented for `TileSetFont`. I'm considering keeping the API of `TileSetFont` but replacing its implementation by a `BMFont` for it to gets all the new shiny features.

Pull-Request: #2527
Reviewed-by: Jean Privat <jean@pryen.org>