-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support for icon-text-fit, icon-text-fit-padding #5334
Conversation
@yhahn Can you please kindly clarify the following?
auto size = layout.textSize / 24.0f; |
No since this would alter the behavior of all existing icons in styles. This is an opt-in mode so it defaults to
Yes, this is the current fixed size of the glyph SDF bitmaps used by Mapbox GL and is a "magic number" that glyph metrics are currently related to. You can think of text shaping as occurring on a 24.0-based scale independently of text size, etc. To convert between shaped text and actual size of quads/pixels on screen the 24.0 magic number needs to be scaled by text size. |
@@ -39,7 +39,21 @@ optional<std::string> parseConstant(const char* name, const JSValue& value) { | |||
|
|||
template <> | |||
optional<Color> parseConstant(const char* name, const JSValue& value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jfirebaugh help : )
Defining
optional<std::array<float, 4>> parseConstant(const char* name, const JSValue& value) {
is considered a redefinition of optional<Color>
. Is there a noninvasive way around this or do we just decide on the semantics here and maybe go with optional<std::array<float, 4>>
as less misleading?
Other options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should introduce a real class definition for Color
, rather than using a typedef. I've been meaning to do this for a while. Want to take a stab?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, will poke you when I have questions.
2ad1490
to
39e798b
Compare
@jfirebaugh ready for review. |
👍 |
Native port of mapbox/mapbox-gl-js#2720.
Backlog