remove chinese
This commit is contained in:
parent
fab7eb39b5
commit
c02ae7cc40
|
@ -658,7 +658,6 @@ function render_elements(master_ass)
|
||||||
buttontext = buttontext:gsub(':%((.?.?.?)%) unknown ', ':%(%1%)') --gsub('%) unknown %(\'', '')
|
buttontext = buttontext:gsub(':%((.?.?.?)%) unknown ', ':%(%1%)') --gsub('%) unknown %(\'', '')
|
||||||
|
|
||||||
local maxchars = element.layout.button.maxchars
|
local maxchars = element.layout.button.maxchars
|
||||||
-- 认为1个中文字符约等于1.5个英文字符
|
|
||||||
local charcount = (buttontext:len() + select(2, buttontext:gsub('[^\128-\193]', ''))*2) / 3
|
local charcount = (buttontext:len() + select(2, buttontext:gsub('[^\128-\193]', ''))*2) / 3
|
||||||
if not (maxchars == nil) and (charcount > maxchars) then
|
if not (maxchars == nil) and (charcount > maxchars) then
|
||||||
local limit = math.max(0, maxchars - 3)
|
local limit = math.max(0, maxchars - 3)
|
||||||
|
|
Loading…
Reference in New Issue