Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想要一个函数,给定一个字符串,以某种字体返回该字符串的宽度。Canvas draw 有类似的东西,但我只能在 draw 函数中设置字体并获取其中字符串的宽度;不是按需提供的。