Emacs frames are shown too wide with "dual spacing" fonts

Bug #596423 reported by Toshio Ito
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Emacs
Unknown
Unknown
Ubuntu Japanese Kaizen Project
Fix Released
Low
Hajime Mizuno
emacs23 (Debian)
Fix Released
Unknown
emacs23 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Affected Packages: emacs23, emacs-snapshot

DESCRIPTION:

Emacs does not support "dual spacing"(Zenkaku) fonts.
So, with something(any?) Japanese font(included dual spacing/half spacingglyphs) in use, their fonts rendered with ugly spaces. And Emacs frames are shown twice as wide as it supposed to be.

How to reproduce:

1) Install below packages
Emacs: 23.1+1-4ubuntu7
ttf-takao-gothic: 003.02.01-2ubuntu1

2) Set
 (add-to-list 'default-frame-alist '(width . 64))
in your .emacs, Emacs frmaes are created with 128 characters width.

This is problematic, e.g., when you use the shell mode, which underestimates the frame width.
As a result, 'ls' command shows its result annoyingly narrowly.

SOLUTION:
a) Apply patch.
http://debbugs.gnu.org/cgi-bin/bugreport.cgi?bug=4129
http://repo.or.cz/w/emacs.git/commitdiff/4598ad269c5402e99604c702825cb8963c693402

b) update Emacs24

============================================================
WORKAROUND:
============================================================

Here is the workaround I found.

1. Create ~/.fonts.conf and write the following to it
<match target="font">
  <test compare="contains" target="pattern" name="lang">
   <string>zh-tw</string>
   <string>zh-cn</string>
   <string>ja</string>
   <string>ko</string>
  </test>
  <edit name="spacing"><int>0</int></edit>
  <edit name="globaladvance"><bool>false</bool></edit>
</match>

2. Run "fc-cache -f -v" to enable the change.
3. Create ~/.Xresources and write the following to it. (You can set the font size to whatever size you like)
Emacs.font: TakaoGothic-12:spacing=0

4. Run "xrdb -remove ~/.Xresources ; xrdb -merge ~/.Xresources" to enable the change.

That's all.
Currently in my environment, the font for Emacs is configured in ~/.Xresources alone.

RELATED LINKS:

There are some people discussing this issue on the Internet, but not in Launchpad.

- http://garakuta.homelinux.org/~nosuke/diary/diary.html?y=2008&m=10&d=15&n=1#15-2
- http://d.hatena.ne.jp/curare/20090811/1249966864

=====================================================================

Revision history for this message
Toshio Ito (debug-ito) wrote :

Well, probably "fc-cache -f -v" thing is not necessary...

Revision history for this message
Fumihito YOSHIDA (hito) wrote :
Revision history for this message
Toshio Ito (debug-ito) wrote :

Thank you for the information, Yoshida-san.
I'm relieved that fix for this bug is going on.

Fumihito YOSHIDA (hito)
Changed in ubuntu-jp-improvement:
importance: Undecided → Low
status: New → Triaged
assignee: nobody → Hajime Mizuno (mizuno-as)
Fumihito YOSHIDA (hito)
description: updated
Revision history for this message
Hajime Mizuno (mizuno-as) wrote :

Reproduction in maverick was confirmed. (maverick Emacs version: 23.1+1-4ubuntu7)

Revision history for this message
Hajime Mizuno (mizuno-as) wrote :
Changed in emacs23 (Debian):
status: Unknown → Confirmed
Revision history for this message
Fumihito YOSHIDA (hito) wrote :

これどうしましょうかね……。http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588808 が止まってるのですが、水野さん対応する余力はありますでしょうか?

Revision history for this message
era (era) wrote :

(Sorry, I don't read Japanese fluently, so this is based on Google's translation.)

Upstream is Fix Committed, Debian is pending on merging from upstream. The options for Ubuntu are to wait for Debian to pull in the upstream change, then merge with Debian; or to add a temporary, Ubuntu-only patch. For a problem which causes severe problems for a group of users, you could consider the latter option. My (limited) understanding is that you can work around this problem by switching to a font which doesn't have this problem (and also there seems to be a workaround of sorts in Emacs bug #4129), so it seems like we would just wait for Debian to upgrade to an Emacs which has this fix. To the best of my judgment, this is unlikely to happen before emacs24.

Outside of "official" Ubuntu, you could certainly extract the upstream patch and build your own version in a PPA. If this bug is annoying to you and many others, this would seem like a good temporary stopgap measure.

Revision history for this message
Fumihito YOSHIDA (hito) wrote :

Ooops, sorry for boorishness.

@era: yes, its solved at Emacs24(maybe), http://repo.or.cz/w/emacs.git/commitdiff/4598ad269c5402e99604c702825cb8963c693402 ,and we(me and mizuno-san) planed temporary release at PPA, but its stacked for a while :(

Revision history for this message
era (era) wrote :

> Ooops, sorry for boorishness.

Absolutely no problem, good to hear that there is a plan. What exactly is holding you up, could you perhaps try to coordinate with bug #588203?

Revision history for this message
Fumihito YOSHIDA (hito) wrote :

Thank you for point out #588203, it seems requisite.
We(me and mizuno-san) will try merging 4598ad269c5402e99604c702825cb8963c693402 and ppa:ubuntu-elisp::23.2+1-4ubuntu1~ppa3 .

Fumihito YOSHIDA (hito)
description: updated
Fumihito YOSHIDA (hito)
summary: - Emacs frames are shown too wide with Takao gothic font
+ Emacs frames are shown too wide with "dual spacing" fonts
Revision history for this message
Hajime Mizuno (mizuno-as) wrote :

I merged 4598ad269c5402e99604c702825cb8963c693402 and ppa:ubuntu-elisp::23.2+1-4ubuntu1~ppa3.
It is temporarily in my PPA https://launchpad.net/~mizuno-as/+archive/ppa (Please wait a little until the build ends).

Changed in emacs23 (Debian):
status: Confirmed → Fix Released
Revision history for this message
Nobuto Murata (nobuto) wrote :
Download full text (4.1 KiB)

This bug was fixed in the package emacs23 - 23.2+1-7ubuntu1 as a result of merge request Bug #705383.

---------------
emacs23 (23.2+1-7ubuntu1) natty; urgency=low

  [ Hajime Mizuno ]
  * Merge from debian unstable(LP: #705383). Remaining changes:
  * debian/control.in:
    - Change Maintainer to Ubuntu Core Developers, per Ubuntu policy.
    - Conflict and Replace emacs23-common-non-dfsg, since we provide
      all of its features.
    - Do not suggest emacs23-common-non-dfsg.
    - Replace use of Source-Version with source:Version.
    - Require autotools-dev (>= 20100122.1) in Build-Depends, since
      the version in Karmic will fail due to a missing Perl module.
  * debian/control: Regenerate.
  * debian/copyright.in:
    - Remove text about removed files.
  * debian/copyright: Regenerate.
  * debian/emacsVER-common.postinst:
    - Don't install info files to info/dir. This happens
      automatically now.
  * debian/emacsVER-common.prerm:
    - Don't remove info files from info/dir. This happens
      automatically now.
  * debian/emacsVER-common.prerm:
    - Don't remove info files from info/dir. This happens
      automatically now.
  * debian/patches:
    - handle-dfsg-split.diff: Remove.
    - ubuntu-restore-nondfsg-files.diff: New patch that reintroduces
      the non-DFSG files, with the exception of .elc files and info
      files, which use special characters and thus can't be easily
      represented in patch form. These will be regenerated at build
      time.
  * debian/rules:
    - Do not install replacements for non-DFSG files.
    - Install all info files, not just efaq.
    - Avoid uselessly building info files a 2nd time.
  * fix-ftbfs-xft-fontconfig.diff to avoid FTBFS.
  * debian/patches/fix-menus.diff: Fix http://debbugs.gnu.org/6499
    (Emacs gets stuck waiting for menu input). (LP: #569914)

emacs23 (23.2+1-7) unstable; urgency=low

  * Don't initialize the terminal twice. Previously a console-mode
    Emacs would send the escape sequence to switch to the alternate
    screen twice. At a minimum, this caused problems with screen.
    Thanks to Courtney Bane <email address hidden> for the
    report and the patch. (closes: #599463)

  * Fix the value for RIPEMD-160 in epg-digest-algorithm-alist
    according to RFC 4880. Thanks to Daniel Kahn Gillmor
    <email address hidden> for the report and the fix.
    (closes: #594510)

emacs23 (23.2+1-6) unstable; urgency=low

  * Build-depend on "bsd-mailx | mailx" rather than just "mailx" since
    the latter is a virtual package. Thanks to Cyril Brulebois
    <email address hidden> for the report, and thanks to Mehdi Dogguy
    <email address hidden> for the 23.2+1-5.1 NMU. (closes: #600826)

emacs23 (23.2+1-5) unstable; urgency=low

  * Apply upstream patches to prevent the string and unibyte-string
    functions from overflowing the stack
    (prevent-string-stack-overflow.diff,
    prevent-let-eval-apply-stack-overflow.diff, and
    use-safe-alloca-lisp-in-let-eval-apply-apply_lambda.diff). Thanks
    to Carl Worth <email address hidden> and Sven Joachim
    <email address hidden> for finding the patches (cl...

Read more...

Changed in emacs23 (Ubuntu):
status: New → Fix Released
Revision history for this message
Nobuto Murata (nobuto) wrote :

also mark as Fix Released against Ubuntu Japanese Kaizen Project.

Changed in ubuntu-jp-improvement:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.