Proper Minetest font and display API

yw05
Member
 
Posts: 114
Joined: Tue May 07, 2019 12:59
Location: linux-forks.de port 30000
IRC: yw05
In-game: ywang

Proper Minetest font and display API

by yw05 » Thu Jun 20, 2019 10:31

I have been playing Minetest for some time, and I soon realized that Minetest needs a proper font and a display API.
There are many different sign mods, and many use different fonts, even when Display Modpack already has a reusable API.
Also, many display/sign mods out there only support as much as Latin characters, but we do know that there are also users who write in another writing system (Cyrillic, Greek, ...). Most fonts do support them. Therefore, there should be a library that allows mods to load text based on existing fonts on the server or the client.
Then we would need a unified font (maybe more?) like Minecraft. The font can be designed based on existing font(s) or mod(pack)s. This would also solve the problem that some text may appear to be blank on some clients because of font support.
Huh, why am I still using Minetest 4.x?
 

User avatar
gpcf
Member
 
Posts: 317
Joined: Fri May 27, 2016 10:48
In-game: gabriel

Re: Proper Minetest font and display API

by gpcf » Fri Jun 21, 2019 07:57

This would solve a lot of headaches, however, I have given up hope that we will see this anytime soon.
 

User avatar
Linuxdirk
Member
 
Posts: 2172
Joined: Wed Sep 17, 2014 11:21
Location: Germany
In-game: Linuxdirk

Re: Proper Minetest font and display API

by Linuxdirk » Fri Jun 21, 2019 08:36

gpcf wrote:This would solve a lot of headaches, however, I have given up hope that we will see this anytime soon.

This applies to most of the issues in Minetest and MTG :)

But for a display API: This would be really convenient if it was integrated into the engine. Something so fundamental like text being shown on signs should not require mods.
 

yw05
Member
 
Posts: 114
Joined: Tue May 07, 2019 12:59
Location: linux-forks.de port 30000
IRC: yw05
In-game: ywang

Re: Proper Minetest font and display API

by yw05 » Fri Jun 21, 2019 10:05

Here are some facts/interesting cases:
1. I play on LinuxWorks Server (as ywang) and I made a joke on a user by giving him access to a construction area and naming it "临时施工区域" (temporary construction site). Then he and a moderator came only to tell me that they only "see spaces", but I do see the area name.
2. Such display APIs can be based on existing fonts, and we don't need to design different fonts for all the scripts, esp. for CJK. With CJK as an example: we can simply scale the texture to 32px (or even less) so that they appear to be (almost) the same for every font. Then we only need to use that specific texture for all the fonts. Also, Latin, Cyrillic, and Greek can share the same texture if they look *that* similar. Therefore, creating fonts for MT based on existing fonts isn't that hard.
3. If we every have such an API, it would be muh easier to add text to things like trains and chests.
4. A lot of things related to Minetest can be found on Baidu (a Chinese search engine), but I haven't (yet) seen anything related to how to write CJK text on signs.
gpcf: IMHO I wouldn't expect this feature to come out soon either. There are other more important things to do than this.
Huh, why am I still using Minetest 4.x?
 

User avatar
Hume2
Member
 
Posts: 329
Joined: Tue Jun 19, 2018 08:24
Location: Czech Republic
GitHub: Hume2
In-game: Hume2

Re: Proper Minetest font and display API

by Hume2 » Fri Jun 21, 2019 11:12

I suggest, the texture modifiers should contain something like ^[text(...) which would put the given text onto the texture.
If you lack the reality, go on a trip or find a job.
 

User avatar
Linuxdirk
Member
 
Posts: 2172
Joined: Wed Sep 17, 2014 11:21
Location: Germany
In-game: Linuxdirk

Re: Proper Minetest font and display API

by Linuxdirk » Fri Jun 21, 2019 12:02

Hume2 wrote:I suggest, the texture modifiers should contain something like ^[text(...) which would put the given text onto the texture.

This does not cover dynamic texts like on signs or for example labelled chests.
 

yw05
Member
 
Posts: 114
Joined: Tue May 07, 2019 12:59
Location: linux-forks.de port 30000
IRC: yw05
In-game: ywang

Re: Proper Minetest font and display API

by yw05 » Fri Jun 21, 2019 14:46

Ehlphabet has a script that generates textures for letter blocks. This probably helps.
Huh, why am I still using Minetest 4.x?
 

User avatar
Pyrollo
Member
 
Posts: 317
Joined: Mon Jan 08, 2018 15:14
Location: Paris
GitHub: pyrollo
In-game: Naj

Re: Proper Minetest font and display API

by Pyrollo » Sat Jun 22, 2019 17:27

Have a look at Display API, Font API and Font Metro. Together they provide all you need:

Display API provides a way to stick dynamic textures on any node, with any size and orientation.

Font API provides anything to render fonts to textures. It can handle various fonts and alignments. It also provides a tool (under linux) for creating texture (and whole font mod) from a TTF font.

Font Metro, relying on Christian Munk "Metro" font provides font including Latin, accentuated, Cyrillic and Greek letters.

This set of mods have been developed to be flexible, adaptable and reusable as much as possible. API are well documented, Maybe it's still missing something but I'm sure it could be a good basis for a standard API.
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]
 

User avatar
Pyrollo
Member
 
Posts: 317
Joined: Mon Jan 08, 2018 15:14
Location: Paris
GitHub: pyrollo
In-game: Naj

Re: Proper Minetest font and display API

by Pyrollo » Sat Jun 22, 2019 17:31

Hume2 wrote:I suggest, the texture modifiers should contain something like ^[text(...) which would put the given text onto the texture.


This is a bit simplistic. Rendering text involves many parameters: font, size, how to handle multi-line text (horizontal align, line height), character spacing and so on.

I guess such way to draw text will result in either very frustrating too simple stuff or over complicated syntax.
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]
 

User avatar
gpcf
Member
 
Posts: 317
Joined: Fri May 27, 2016 10:48
In-game: gabriel

Re: Proper Minetest font and display API

by gpcf » Sat Jun 22, 2019 17:50

Display and Font API are nice, but still hacky unlike an API directly integrated into the engine.
 

yw05
Member
 
Posts: 114
Joined: Tue May 07, 2019 12:59
Location: linux-forks.de port 30000
IRC: yw05
In-game: ywang

Re: Proper Minetest font and display API

by yw05 » Sun Jun 23, 2019 01:16

Pyrollo wrote:Have a look at Display API, Font API and Font Metro. Together they provide all you need:

Display API provides a way to stick dynamic textures on any node, with any size and orientation.

Font API provides anything to render fonts to textures. It can handle various fonts and alignments. It also provides a tool (under linux) for creating texture (and whole font mod) from a TTF font.

Font Metro, relying on Christian Munk "Metro" font provides font including Latin, accentuated, Cyrillic and Greek letters.

This set of mods have been developed to be flexible, adaptable and reusable as much as possible. API are well documented, Maybe it's still missing something but I'm sure it could be a good basis for a standard API.


1. When I wrote this, I have made it clear that I want this to be part of the engine, not as a mod. I know display_modpack and these mods.
2. I don't see how your mods can "solve the problem that some text may appear to be blank on some clients because of font support" as I wrote in the first post.
Huh, why am I still using Minetest 4.x?
 

User avatar
Hume2
Member
 
Posts: 329
Joined: Tue Jun 19, 2018 08:24
Location: Czech Republic
GitHub: Hume2
In-game: Hume2

Re: Proper Minetest font and display API

by Hume2 » Sun Jun 23, 2019 09:09

Linuxdirk wrote:This does not cover dynamic texts like on signs or for example labelled chests.

Well, I looked into a few mods which display text and they use an entity which has a texture composed using such modifiers. So instead of composing the text from single character, there would be a single modifier for putting whole strings.

Pyrollo wrote:This is a bit simplistic. Rendering text involves many parameters: font, size, how to handle multi-line text (horizontal align, line height), character spacing and so on.

I guess such way to draw text will result in either very frustrating too simple stuff or over complicated syntax.

Well, some of the parameters might be optional. Also keep in mind that currently the text must be composed by putting each character extra, which is even more complicated.
If you lack the reality, go on a trip or find a job.
 


Return to Feature Discussion



Who is online

Users browsing this forum: No registered users and 2 guests