Skip to content
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

Add outline rendering to TextLayer #5483

Merged
merged 2 commits into from
Feb 15, 2021
Merged

Conversation

Pessimistress
Copy link
Collaborator

@Pessimistress Pessimistress commented Feb 14, 2021

For #3750 #4579

Screen Shot 2021-02-14 at 2 58 28 PM

Change List

  • Add outlineWidth and outlineColor props
  • Documentation

@@ -147,12 +147,11 @@ Advance options for fine tuning the appearance and performance of the generated
Options:

* `fontSize` (Number): Font size in pixels. Default is `64`. This option is only applied for generating `fontAtlas`, it does not impact the size of displayed text labels. Larger `fontSize` will give you a sharper look when rendering text labels with very large font sizes. But larger `fontSize` requires more time and space to generate the `fontAtlas`.
* `buffer` (Number): Whitespace buffer around each side of the character. Default is `2`. In general, bigger `fontSize` requires bigger `buffer`. Increase `buffer` will add more space between each character when layout `characterSet` in `fontAtlas`. This option could be tuned to provide sufficient space for drawing each character and avoiding overlapping of neighboring characters. But the cost of bigger `buffer` is more time and space to generate `fontAtlas`.
* `buffer` (Number): Whitespace buffer around each side of the character. Default is `4`. In general, bigger `fontSize` requires bigger `buffer`. Increase `buffer` will add more space between each character when layout `characterSet` in `fontAtlas`. This option could be tuned to provide sufficient space for drawing each character and avoiding overlapping of neighboring characters. But the cost of bigger `buffer` is more time and space to generate `fontAtlas`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is more time and space to generate fontAtlas.

is that bad enough that it needs to be mentioned?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space might be more important here, as the resolution/character count of the font atlas is limited by the maximum texture size.

modules/layers/src/text-layer/text-layer.js Show resolved Hide resolved
Base automatically changed from x/text-layer-background to master February 15, 2021 22:35
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.002%) to 82.418% when pulling 698d01a on x/text-layer-outline into 612eef6 on master.

@Pessimistress Pessimistress merged commit 8903d87 into master Feb 15, 2021
@Pessimistress Pessimistress deleted the x/text-layer-outline branch February 24, 2021 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants