all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* thai font problem
@ 2003-08-27  9:02 Werner LEMBERG
  2003-08-29 12:40 ` Kenichi Handa
  0 siblings, 1 reply; 5+ messages in thread
From: Werner LEMBERG @ 2003-08-27  9:02 UTC (permalink / raw)



I set up my fonts in .emacs with

  (defvar fontset-24
    "-*-fixed-medium-r-*-*-24-*-*-*-*-*-fontset-24")
  (create-fontset-from-fontset-spec fontset-24)

to get ETL 24 pixel fonts.  Until recently this has also worked for
Thai, but now (CVS 2003-08-16) I get the font

  -ETL-Fixed-Medium-R-Normal--18-180-72-72-C-90-TIS620.2529-1

instead of the 24 pixel version.  Looks like a bug...


    Werner

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

* Re: thai font problem
  2003-08-27  9:02 thai font problem Werner LEMBERG
@ 2003-08-29 12:40 ` Kenichi Handa
  2003-08-31  7:19   ` Werner LEMBERG
  0 siblings, 1 reply; 5+ messages in thread
From: Kenichi Handa @ 2003-08-29 12:40 UTC (permalink / raw)
  Cc: emacs-devel

In article <20030827.110253.39152163.wl@gnu.org>, Werner LEMBERG <wl@gnu.org> writes:

> I set up my fonts in .emacs with

>   (defvar fontset-24
>     "-*-fixed-medium-r-*-*-24-*-*-*-*-*-fontset-24")
>   (create-fontset-from-fontset-spec fontset-24)

> to get ETL 24 pixel fonts.  Until recently this has also worked for
> Thai, but now (CVS 2003-08-16) I get the font

>   -ETL-Fixed-Medium-R-Normal--18-180-72-72-C-90-TIS620.2529-1

> instead of the 24 pixel version.  Looks like a bug...

I think the following change is the reason.

2003-08-15  Kenichi Handa  <handa@m17n.org>

	* international/fontset.el (setup-default-fontset): Change "*" to
	nil in the specifications of font family.

Could you try this?

(set-fontset-font "fontset-default" 'thai-tis620 '("*" . "TIS620"))
(clear-face-cache t)

---
Ken'ichi HANDA
handa@m17n.org

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

* Re: thai font problem
  2003-08-29 12:40 ` Kenichi Handa
@ 2003-08-31  7:19   ` Werner LEMBERG
  2003-09-01 11:19     ` Kenichi Handa
  0 siblings, 1 reply; 5+ messages in thread
From: Werner LEMBERG @ 2003-08-31  7:19 UTC (permalink / raw)
  Cc: emacs-devel


> Could you try this?
> 
> (set-fontset-font "fontset-default" 'thai-tis620 '("*" . "TIS620"))
> (clear-face-cache t)

This works, thanks.  Will a similar fix be applied to the CVS?


    Werner

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

* Re: thai font problem
  2003-08-31  7:19   ` Werner LEMBERG
@ 2003-09-01 11:19     ` Kenichi Handa
  2003-09-01 21:09       ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Kenichi Handa @ 2003-09-01 11:19 UTC (permalink / raw)
  Cc: emacs-devel

In article <20030831.091915.59468909.wl@gnu.org>, Werner LEMBERG <wl@gnu.org> writes:
>>  Could you try this?
>>  
>>  (set-fontset-font "fontset-default" 'thai-tis620 '("*" . "TIS620"))
>>  (clear-face-cache t)

> This works, thanks.  Will a similar fix be applied to the CVS?

Here we have a fundamental problem of the current font
selection mechanism.

If a font family is specified (by face or by fontset), Emacs
prefers a font of the specifed family even if the font size
is worse than the other font of different family.  And a
family specification of fontset has higher priority than
that of face.

Before my change, the default fontset specifies the family
"*" for most non-ASCII characters.  So, Emacs finds the best
matching font while ignoring face family for non-ASCII
characters (because any family matches "*").

This setting was good until a while ago because we didn't
have that many family variations for non-ASCII characters.

But, such a setting is just to cheat the font-selection
routine.  And, in these days, for instance, we have many
families of Japanese fonts.  In this environment, people
want to control font-selection by face family even for
Japanese.

So I changed the default fontset not to specify a family for
non-ASCII characters.

Now what happend to you is this.

As your default font is -etl-fixed-..., the default face has
family "etl-fixed".  And you surely have a Thai font of that
family.  So, that font is selected even if the size is worse
than that 24-dot Thai font of family "misc-fixed".

For a workaround, I installed the above change.

But, I think it's basically not the right thing to set "*"
family in the default fontset.  To solve the Thai font
problem, we need fine-tuning mechanism in font selection.
For instance, if the size of a selected font is very
different from the requested size, try to select another
font by ignoring a family.  But, how to decide that the font
size is "very different"?  Don't we have to suppress such a
mechanism for ASCII font?  I'm not sure.

Unfortunetely, I don't have a time to design a better font
selection mechanism for the moment.

---
Ken'ichi HANDA
handa@m17n.org

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

* Re: thai font problem
  2003-09-01 11:19     ` Kenichi Handa
@ 2003-09-01 21:09       ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2003-09-01 21:09 UTC (permalink / raw)
  Cc: wl, emacs-devel

> But, I think it's basically not the right thing to set "*"
> family in the default fontset.  To solve the Thai font
> problem, we need fine-tuning mechanism in font selection.
> For instance, if the size of a selected font is very
> different from the requested size, try to select another
> font by ignoring a family.  But, how to decide that the font
> size is "very different"?  Don't we have to suppress such a
> mechanism for ASCII font?  I'm not sure.

I had a patch that introduced a "max-fuzz" variable such that any font whose
size is too far apart (by default the acceptable fuzz was 12.5%) from the
target size is rejected.

The original reason for introducing it was to give preference to unscaled
bitmap fonts while still reverting to a scaled font (potentially auto-scaled
from a bitmap) if the requested size was not close to any of the bitmap
fonts available.

I can't find the patch any more, tho.  Hopefully, anti-aliasing will make
bitmap fonts obsolete soon enough.


        Stefan

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

end of thread, other threads:[~2003-09-01 21:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-27  9:02 thai font problem Werner LEMBERG
2003-08-29 12:40 ` Kenichi Handa
2003-08-31  7:19   ` Werner LEMBERG
2003-09-01 11:19     ` Kenichi Handa
2003-09-01 21:09       ` Stefan Monnier

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.