mapbox / mapbox/mapbox-gl-js

More aggressively convert punctuation into fullwidth

Open
#3,587 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature :green_apple:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

Following up from https://github.com/mapbox/mapbox-gl-js/issues/3505#issuecomment-257971452 and https://github.com/mapbox/mapbox-gl-js/pull/3438#issuecomment-259611065, we should replace certain non-CJK punctuation with their fullwidth equivalents more aggressively to avoid rotating them.

For example, `壹貳參(com)` correctly becomes:

```



ᴒ͡


͝
```

but `com(壹貳參)` becomes:

```



壹͡



```

whereas it should be:

```








```

To get this right, we need to split `verticalize_punctuation.lookup` into three lookup tables (`leftBinding`, `leftAndRightBinding`, and `rightBinding`) and consider only the side(s) to which the character is naturally bound. So `(` would be part of `rightBinding` because the character to the right is the only one that determines its ideographic-ness, whereas `@` would be part of `leftAndRightBinding` because either adjacent character can make it non-ideographic.

/cc @lucaswoj @nickidlugash

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with verticalize_punctuation.lookup and the surrounding verticalization logic. Compare the issue's examples for punctuation beside CJK and non-CJK characters, then verify that the separated binding rules produce the expected fullwidth punctuation and avoid incorrect rotation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.