all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#4129: Support for dual spacing fonts
@ 2009-08-12  1:55 Takanori MATSUURA
  2010-04-21  1:28 ` Takanori MATSUURA
  2010-06-25 17:10 ` bug#4129: Emacs still have font spacing problem Naohiro Aota
  0 siblings, 2 replies; 4+ messages in thread
From: Takanori MATSUURA @ 2009-08-12  1:55 UTC (permalink / raw
  To: bug-gnu-emacs

When I use IPAGothic font with emacs-23.1, ASCII characters are shown
as character itself and extra space (ie. "A ", "t ").  The font have
the spacing value of "90" which means dual spacing. If I explicitly
define the spacing to "0", this font-width issue is solved.

Other software which use fontconfig can treat IPAGothic fonts
properly.  So I'm afraid that emacs doesn't handle it.


Fonts are shown with wrong spacing:
Add ~/.emacs to
(set-frame-font "IPAGothic")

Fonts are shown properly:
Add ~/.emacs to
(set-frame-font "IPAGothic:spacing=0")

And add the following fontconfig configuration
<match target="font">
  <test name="family">
     <string>IPAGothic</string>
  </test>
  <edit name="spacing">
     <int>0</int>
  </edit>
  <edit name="globaladvance">
     <bool>false</bool>
  </edit>
</match>


IPAGothic font is available from:
http://ossipedia.ipa.go.jp/ipafont/
(Both Japanese and English contents included in one page. same meaning)


Regards,
Takanori






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#4129: Support for dual spacing fonts
  2009-08-12  1:55 bug#4129: Support for dual spacing fonts Takanori MATSUURA
@ 2010-04-21  1:28 ` Takanori MATSUURA
  2010-06-25 17:10 ` bug#4129: Emacs still have font spacing problem Naohiro Aota
  1 sibling, 0 replies; 4+ messages in thread
From: Takanori MATSUURA @ 2010-04-21  1:28 UTC (permalink / raw
  To: 4129

[-- Attachment #1: Type: text/plain, Size: 69 bytes --]

Please find the file attached.

The patch fixes bug#4129.


Takanori

[-- Attachment #2: emacs-23.1-spacing.patch --]
[-- Type: text/x-patch, Size: 949 bytes --]

diff --git a/src/ftfont.c b/src/ftfont.c
index 4ebc4be..bac9a4f 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -1262,7 +1262,7 @@ ftfont_open (f, entity, pixel_size)
     spacing = XINT (AREF (entity, FONT_SPACING_INDEX));
   else
     spacing = FC_PROPORTIONAL;
-  if (spacing != FC_PROPORTIONAL)
+  if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL)
     font->min_width = font->average_width = font->space_width
       = (scalable ? ft_face->max_advance_width * size / upEM
 	 : ft_face->size->metrics.max_advance >> 6);
diff --git a/src/xftfont.c b/src/xftfont.c
index 82701ce..e74ce31 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -418,7 +418,7 @@ xftfont_open (f, entity, pixel_size)
 	ascii_printable[i] = ' ' + i;
     }
   BLOCK_INPUT;
-  if (spacing != FC_PROPORTIONAL)
+  if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL)
     {
       font->min_width = font->average_width = font->space_width
 	= xftfont->max_advance_width;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#4129: Emacs still have font spacing problem
  2009-08-12  1:55 bug#4129: Support for dual spacing fonts Takanori MATSUURA
  2010-04-21  1:28 ` Takanori MATSUURA
@ 2010-06-25 17:10 ` Naohiro Aota
  2010-06-30  6:57   ` Kenichi Handa
  1 sibling, 1 reply; 4+ messages in thread
From: Naohiro Aota @ 2010-06-25 17:10 UTC (permalink / raw
  To: 4129

Hi, list

As I post last year [1], Emacs still doesn't deal with fonts whose
spacing is set to FC_DUAL. Please see this screen-shot I've sent last
year [2]. You see disgusting Elisp indentation, don't you?

This is all because Emacs assume "space width" is as same as "font max
width" only just if the font is not "PROPORTIONAL". Some Japanese are
using "DUAL" fonts (M+ font, IPA font and so on). These fonts have
"glyphs in precisely two widths, one twice as wide as the other" [3],
Emacs shouldn't use "max width" for "min width" and "space width" when
there is two kinds of width!

Please please think applying the patch.

Regards,

[1] http://article.gmane.org/gmane.emacs.devel/111557/
[2] http://article.gmane.org/gmane.emacs.devel/111572/
[3] http://fontconfig.org/fontconfig-devel/fcfreetypecharsetandspacing.html





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#4129: Emacs still have font spacing problem
  2010-06-25 17:10 ` bug#4129: Emacs still have font spacing problem Naohiro Aota
@ 2010-06-30  6:57   ` Kenichi Handa
  0 siblings, 0 replies; 4+ messages in thread
From: Kenichi Handa @ 2010-06-30  6:57 UTC (permalink / raw
  To: Naohiro Aota; +Cc: 4129

In article <20100626.021033.1233076457334905269.naota@elisp.net>, Naohiro Aota <naota@elisp.net> writes:

> As I post last year [1], Emacs still doesn't deal with fonts whose
> spacing is set to FC_DUAL. Please see this screen-shot I've sent last
> year [2]. You see disgusting Elisp indentation, don't you?

> This is all because Emacs assume "space width" is as same as "font max
> width" only just if the font is not "PROPORTIONAL". Some Japanese are
> using "DUAL" fonts (M+ font, IPA font and so on). These fonts have
> "glyphs in precisely two widths, one twice as wide as the other" [3],
> Emacs shouldn't use "max width" for "min width" and "space width" when
> there is two kinds of width!

> Please please think applying the patch.

Thank you for the patch, and I'm very sorry for the late
response on this matter.  It seems that I somehow missed
your first report.

I've just applied your patch in this mail:

> [1] http://article.gmane.org/gmane.emacs.devel/111557/

---
Kenichi Handa
handa@m17n.org





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-06-30  6:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-12  1:55 bug#4129: Support for dual spacing fonts Takanori MATSUURA
2010-04-21  1:28 ` Takanori MATSUURA
2010-06-25 17:10 ` bug#4129: Emacs still have font spacing problem Naohiro Aota
2010-06-30  6:57   ` Kenichi Handa

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.