maptalks / maptalks/maptalks.js

canvas.measureText result is not right for some charsets

Open
#1,865 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
4.5k
Forks
511
Avg merge
3d 58m
Merged PRs (30d)
1

Description

**maptalks's version and what browser you use?**
----
v1.0.0-rc.17

**Issue description**
----
canvas.measureText result is not right for some charsets
![603LB %R$VHLV{L)H1AGPJM](https://user-images.githubusercontent.com/13678919/209636073-3c4c9795-7040-40b4-8170-d85b050232da.png)

![ZJBSE${%OPZBA%D@MT }3$M](https://user-images.githubusercontent.com/13678919/209636058-995a09d8-87a4-4141-872e-d88030419c38.jpg)

**Please provide a reproduction URL (on any jsfiddle like site)**
----
[string-width-demo.zip](https://github.com/maptalks/maptalks.js/files/10306920/string-width-demo.zip)

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 the attached string-width-demo.zip reproduction and inspect where canvas.measureText is called for the affected character sets. Compare the reported widths with the screenshots and determine the expected result; done means the reproduction reports correct measurements for those character sets.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.