We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
更改前
async def self_adaption_font_of_text(font_filename, default_font_size: int, text: str): """ 获取一段文本所占的宽度像素值 返回字符画的 width, height """ ttfont = ImageFont.truetype(font_filename, default_font_size) lines = text.split("\n") w = ttfont.getsize(lines[2])[0] return ( ttfont, w, default_font_size * len(lines) + int(1.2 * len(lines)), ) # 高度不会搞,1.2 是瞎jb调的,等一个大佬(
更改后
async def self_adaption_font_of_text(font_filename, default_font_size: int, text: str): """ 获取一段文本所占的宽度像素值 返回字符画的 width, height """ ttfont = ImageFont.truetype(font_filename, default_font_size) w, h = ttfont.getsize_multiline(text.strip()) return ttfont,w,h
The text was updated successfully, but these errors were encountered:
更改前 async def self_adaption_font_of_text(font_filename, default_font_size: int, text: str): """ 获取一段文本所占的宽度像素值 返回字符画的 width, height """ ttfont = ImageFont.truetype(font_filename, default_font_size) lines = text.split("\n") w = ttfont.getsize(lines[2])[0] return ( ttfont, w, default_font_size * len(lines) + int(1.2 * len(lines)), ) # 高度不会搞,1.2 是瞎jb调的,等一个大佬( 更改后 async def self_adaption_font_of_text(font_filename, default_font_size: int, text: str): """ 获取一段文本所占的宽度像素值 返回字符画的 width, height """ ttfont = ImageFont.truetype(font_filename, default_font_size) w, h = ttfont.getsize_multiline(text.strip()) return ttfont,w,h
收到!
Sorry, something went wrong.
No branches or pull requests
更改前
更改后
The text was updated successfully, but these errors were encountered: