|
From: | 黄建忠 |
Subject: | Re: A patch for enforcing double-width CJK character display |
Date: | Thu, 12 Apr 2012 16:56:16 +0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120327 Thunderbird/10.0.2 |
Here is a try to fix "text-scale-increase/decrease" CJK double width issue.I did not want to change external codes, So introduce a dirty workaround and a global static variable "default_font_width", The comments in this patch explained the idea and necessity. "get_default_font_width" function is called by "xftfont_text_extents" and "xftfont_draw" to get default font width correctly after scale.
Can anybody provide a clue how to catch the new width of default font via FRAME_PTR when scale happened?
于 2012年04月12日 00:16, 黄建忠 写道:
Thanks for reply. I checked with "text-scale-increase" and it did not work.When scale happened, the space_width and column_width of frame did not changed, I need find another way to get monospace font width after scale. But I think we can store the default font face to every xftfont_info and when scale happened, re-caculate the space width of default face.Let me try, thanks for the feedback. 于 2012年04月11日 23:48, Kan-Ru Chen 写道:[ CC:ed emacs-devel ] Hi! 黄建忠<address@hidden> writes:Here is a patch to fix double-width issue of CJK fonts when use Xft backend , just like some terminal did.I like you idea to draw glyphs individually when the font is a CJK font. I didn't realized that when the font changes, XftDrawGlyphs is called again so we have a chance to examine the font! Your patch probably needs some adjust to fit the coding style, but the approach is great! Did you check that it also works with scaled fonts? Like (text-scale-increase) multiple times. Kanru
-- 黄建忠 技术总监 普华基础软件股份有限公司 基础软件事业部 电话:010-82664919-8201 传真:010-82664407 手机:13501162460 网址:http://www.i-soft.com.cn 地址:中国北京市海淀区海淀东三街欧美汇大厦9层 邮编:100080
emacs-cjk-monospace-v5.patch
Description: Text document
[Prev in Thread] | Current Thread | [Next in Thread] |