-
-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change default value for text-font to Noto Sans Regular #311
Comments
I don't have any objections, but there isn't a near future plan to release a major breaking change version. |
That's perfectly fine, we can revisit this at at a later date - just seems odd to have an unusable default |
I can't argue with that... |
Good idea in general, but this would be a breaking change in the style specification which I think we should avoid. Or am I missing something? |
Technically yes, but if you relay on the default font you are probably doing something wrong. |
Yes. Specifying fonts needs to be done in conjunction with specifying the URL for fonts, so defaults make little practical sense. |
+1 |
Another alternative is to avoid having a default Several components have to be set and served properly in order for the text to show. Having a default for |
Another option is to have a style property of "global default font" in order to reduce the need to specify the font for every label and allow override this when you want to set a different font for a specific label. |
I think this option can, and should, be incorporated with any of the alternatives: changing the default or removing the default all together. |
I like the approach of removing an implicit default and permitting an explicit default to reduce “noise.” |
I also like not having an implicit default. Having to specify the font stack for every layer is indeed tedious, so I like the idea of adding an explicit, user-specified default for all layers. Also, this is tangential, but while we're talking about changing the spec for fonts anyway... I have run into situations where it would be nice to serve different font stacks from different URLs. This can currently be accomplished using a request transform, but it would be nice if the style spec supported specifying different URLs for each font stack. I think this could be done in such a way as to be a non-breaking change. |
I would recommend opening a different discussion around multiple glyph urls. |
I was wondering how different the fonts look:
It looks like the font weight but also the default line height change noticably. Does anyone have some real live examples? Maybe with white text on dark which will likely make the thinner weights more visible… |
By this reasoning we should remove the default, and not change it. |
My suggestion here it to change the behavior from implicit to explicit default - i.e. have it declared and not hard coded. |
I think making the global default font configurable with the default set to the current value is a good idea. Like this we can avoid a breaking change to the style specification but still have an easy way to configure a global default font. What should the new property look like? |
Since the property is called What I suggest is:
|
Sounds good. Shouldn't the new default be |
How about |
Sure, both suggestion are fine by me. |
Also, does an array of strings actually cause MapLibre to fall back when something isn't found? I thought that was something that happened server-side in mapbox land. Not that I wouldn't welcome such functionality! |
It does not fall back on the client, you need to build a fallback by generating a static fontstack with multiple TTFs, or dynamically composing them, and then putting a comma in the fontstack name. |
Closing to avoid backwards-compatible changes with limited benefit. Maybe for a future major revision... |
This would be great. If you don't specify the text-font in your layers (which happens a lot) and you change the style to another vector tiles provider you will probably get a blank screen as most of the providers I tested (esri, here, amazon) don't host maplibre's default font. The way around this for me was to change the glyphs url to my own (and host a lot of fonts) after the style is loaded. But it makes more sense to keep the original one included in the provider's style. |
I don't understand why are we worried that it's a breaking change, since the users do not have the proprietary Arial fonts installed anyway. Basically thing are broken by definition here. And no, I don't think Arial should be hosted by repos here, look at my ticket here: |
How do you know they don't have this font? How can you be sure this won't break how this map looks? |
How do they "have" Even if you happen to have this font installed on your Windows machine, quoting Microsoft Font redistribution FAQ: You do not have rights to: Basically no one has the right to host Arial fonts on the web. I don't understand why is this project worried about braking a situation which is not even legal. |
MapLibre Native has different font loading backends and it is able to load local fonts. It can for example use MapLibre GL JS will make a web request when loading a font (I assume). You could have a smart server with a fallback mechanism too, but the |
Design Proposal: Change the default value of text-font.
Motivation
The current default
text-font
if no value is specified isOpen Sans Regular, Arial Unicode MS Regular
maplibre-style-spec/src/reference/v8.json
Line 1783 in d665496
The issues with this current situation:
Proposed Change
Change the default value to
Noto Sans Regular
. This is an openly licensed font designed for maximum coverage, and can be made available for most MapLibre users.API Modifications
This is a breaking change if users depend on the old default behavior. There shouldn't be many, unless their client is fetching from Mapbox.
Migration Plan and Compatibility
This should accompany a major version release of maplibre-gl-js and maplibre-native, because of the change in default value behavior.
Rejected Alternatives
Related Issues
maplibre/maplibre-gl-js#2990
maplibre/maplibre-gl-js#1051
maplibre/font-maker#16
The text was updated successfully, but these errors were encountered: