all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Display characters with a different size?
@ 2012-06-10 14:02 XeCycle
  2012-06-10 16:26 ` Peter Dyballa
  0 siblings, 1 reply; 11+ messages in thread
From: XeCycle @ 2012-06-10 14:02 UTC (permalink / raw
  To: help-gnu-emacs

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

Hello,

I want to tell Emacs to ignore size specifications in a font, and
use another size instead.  Is it possible?

The use case is, I chose two font for my display, one for English
and common symbols (or, what you'd expect from an English text),
another for Chinese and complicated UTF symbols.  They're of
different size, even on the same size number; it messes up the
display.  I therefore want to tell Emacs to display those Chinese
characters with width twice the same as the former, and height
same as the former.

I searched in the docs and didn't found it.  Afraid it's not
available now.

(emacs-version) "GNU Emacs 24.1.50.1 (x86_64-unknown-linux-gnu,
GTK+ Version 3.4.3) of 2012-05-24 on XeCycle"

Thank you.

-- 
Carl Lei (XeCycle)
Department of Physics, Shanghai Jiao Tong University
OpenPGP public key: 7795E591
Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: Display characters with a different size?
  2012-06-10 14:02 Display characters with a different size? XeCycle
@ 2012-06-10 16:26 ` Peter Dyballa
  2012-06-11  3:57   ` XeCycle
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Dyballa @ 2012-06-10 16:26 UTC (permalink / raw
  To: XeCycle; +Cc: help-gnu-emacs


Am 10.06.2012 um 16:02 schrieb XeCycle:

> I therefore want to tell Emacs to display those Chinese
> characters with width twice the same as the former, and height
> same as the former.

Does that mean that these would look like on a Cinemascope screen?

Creating a fontset that uses for different Unicode ranges different (sized) fonts should be the way. Like that X resource maybe:

	(create-fontset-from-fontset-spec
	  "-apple-monaco-medium-r-normal--9-*-*-*-*-*-fontset-monaco,
	  ascii:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman,
	latin-iso8859-15:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman,
	latin-iso8859-1:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman")
	
	(set-frame-font "fontset-monaco")
	
	(add-to-list 'default-frame-alist
	 '(font . "fontset-monaco"))

Maybe you can use fontconfig names like <font name>-9...

--
Greetings

  Pete

The best way to accelerate a PC is 9.8 m/s²




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

* Re: Display characters with a different size?
  2012-06-10 16:26 ` Peter Dyballa
@ 2012-06-11  3:57   ` XeCycle
  2012-06-11 13:56     ` Peter Dyballa
  2012-06-12  3:37     ` Kevin Rodgers
  0 siblings, 2 replies; 11+ messages in thread
From: XeCycle @ 2012-06-11  3:57 UTC (permalink / raw
  To: Peter Dyballa; +Cc: help-gnu-emacs

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

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 10.06.2012 um 16:02 schrieb XeCycle:
>
>> I therefore want to tell Emacs to display those Chinese
>> characters with width twice the same as the former, and height
>> same as the former.
>
> Does that mean that these would look like on a Cinemascope
> screen?

Don't know what you mean :(

The problem is, when I have mixed Chinese and English, the
display is not monospaced anymore.  This is my font
configuration:

--8<---------------cut here---------------start------------->8---
(create-fontset-from-fontset-spec
 "-adobe-Courier Std-normal-normal-normal-*-19-*-*-*-m-0-fontset-courier")
(set-fontset-font
 "fontset-courier" 'han
 "-adobe-Adobe Heiti Std-normal-normal-normal-*-19-*-*-*-*-0-iso10646-1"
 nil 'prepend)
(add-to-list 'default-frame-alist
             '(font . "fontset-courier"))
--8<---------------cut here---------------end--------------->8---

You see, I set them to the same size.  But the latter font is
taller, so breaks vertical alignment; the width is smaller than
width_of(Courier) * 2, so breaks horizontal alignment.

I can tweak the size of Heiti to be larger, to have the same
width; but the resulting display is rather ugly.

> Creating a fontset that uses for different Unicode ranges
> different (sized) fonts should be the way. Like that X resource
> maybe:
>
> 	(create-fontset-from-fontset-spec
> 	  "-apple-monaco-medium-r-normal--9-*-*-*-*-*-fontset-monaco,
> 	  ascii:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman,
> 	latin-iso8859-15:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman,
> 	latin-iso8859-1:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman")

Thanks for the hint, but I don't know what's inside these magic
numbers.  Can you show me a doc for this?

[...]


-- 
Carl Lei (XeCycle)
Department of Physics, Shanghai Jiao Tong University
OpenPGP public key: 7795E591
Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: Display characters with a different size?
  2012-06-11  3:57   ` XeCycle
@ 2012-06-11 13:56     ` Peter Dyballa
  2012-06-12 13:38       ` XeCycle
  2012-06-12  3:37     ` Kevin Rodgers
  1 sibling, 1 reply; 11+ messages in thread
From: Peter Dyballa @ 2012-06-11 13:56 UTC (permalink / raw
  To: XeCycle; +Cc: help-gnu-emacs


Am 11.06.2012 um 05:57 schrieb XeCycle:

>> Does that mean that these would look like on a Cinemascope
>> screen?
> 
> Don't know what you mean :(

I imagined stretching the Latin characters that they meet the width of CJK ideograms...

> 
> The problem is, when I have mixed Chinese and English, the
> display is not monospaced anymore.  This is my font
> configuration:

Is there no font with FULLWIDTH characters and digits etc.? It's the character block of halfwidth and fullwidth forms, U+FF00-U+FFEF. A few fonts have them. You would need to map U+0030 to U+FF10...

--
Greetings

  Pete

For some reason, this fortune reminds everyone of Marvin Zelkowitz.




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

* Re: Display characters with a different size?
  2012-06-11  3:57   ` XeCycle
  2012-06-11 13:56     ` Peter Dyballa
@ 2012-06-12  3:37     ` Kevin Rodgers
  2012-06-12 13:28       ` XeCycle
  1 sibling, 1 reply; 11+ messages in thread
From: Kevin Rodgers @ 2012-06-12  3:37 UTC (permalink / raw
  To: help-gnu-emacs

On 6/10/12 9:57 PM, XeCycle wrote:
> Peter Dyballa<Peter_Dyballa@Web.DE>  writes:
...
>> Creating a fontset that uses for different Unicode ranges
>> different (sized) fonts should be the way. Like that X resource
>> maybe:
>>
>> 	(create-fontset-from-fontset-spec
>> 	  "-apple-monaco-medium-r-normal--9-*-*-*-*-*-fontset-monaco,
>> 	  ascii:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman,
>> 	latin-iso8859-15:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman,
>> 	latin-iso8859-1:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman")
>
> Thanks for the hint, but I don't know what's inside these magic
> numbers.  Can you show me a doc for this?

Search for XLFD (X Logical Font Description).

-- 
Kevin Rodgers
Denver, Colorado, USA




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

* Re: Display characters with a different size?
  2012-06-12  3:37     ` Kevin Rodgers
@ 2012-06-12 13:28       ` XeCycle
  0 siblings, 0 replies; 11+ messages in thread
From: XeCycle @ 2012-06-12 13:28 UTC (permalink / raw
  To: help-gnu-emacs

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

Kevin Rodgers <kevin.d.rodgers@gmail.com> writes:

[...]

>> Thanks for the hint, but I don't know what's inside these magic
>> numbers.  Can you show me a doc for this?
>
> Search for XLFD (X Logical Font Description).

I read it on Wiki, but it doesn't seem to be able to change the
size.

-- 
Carl Lei (XeCycle)
Department of Physics, Shanghai Jiao Tong University
OpenPGP public key: 7795E591
Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: Display characters with a different size?
  2012-06-11 13:56     ` Peter Dyballa
@ 2012-06-12 13:38       ` XeCycle
  2012-06-12 15:00         ` Peter Dyballa
  0 siblings, 1 reply; 11+ messages in thread
From: XeCycle @ 2012-06-12 13:38 UTC (permalink / raw
  To: Peter Dyballa; +Cc: help-gnu-emacs

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

Peter Dyballa <Peter_Dyballa@Web.de> writes:

> Am 11.06.2012 um 05:57 schrieb XeCycle:
>
>>> Does that mean that these would look like on a Cinemascope
>>> screen?
>> 
>> Don't know what you mean :(
>
> I imagined stretching the Latin characters that they meet the
> width of CJK ideograms...

The two fonts are of different metrics.  I want to force them to
be same.

>> The problem is, when I have mixed Chinese and English, the
>> display is not monospaced anymore.  This is my font
>> configuration:
>
> Is there no font with FULLWIDTH characters and digits etc.? It's
> the character block of halfwidth and fullwidth forms,
> U+FF00-U+FFEF. A few fonts have them. You would need to map
> U+0030 to U+FF10...

Yes, full-width ones differ from half-width ones; but my Chinese
font is not monospaced.  That doesn't matter, though, since all
Chinese characters are naturally monospace; and, I tried using a
mono one with the same problem.

Is modifying the fonts the only way to do this?

-- 
Carl Lei (XeCycle)
Department of Physics, Shanghai Jiao Tong University
OpenPGP public key: 7795E591
Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: Display characters with a different size?
  2012-06-12 13:38       ` XeCycle
@ 2012-06-12 15:00         ` Peter Dyballa
  2012-06-12 17:02           ` XeCycle
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Dyballa @ 2012-06-12 15:00 UTC (permalink / raw
  To: XeCycle; +Cc: help-gnu-emacs


Am 12.06.2012 um 15:38 schrieb XeCycle:

> The two fonts are of different metrics.  I want to force them to
> be same.

That won't work, at least not in the way you want it to. CJK ideograms fit into a more quadratic ("full-width") box while Latin characters fit more into a rectangular box ("half-width"). Therefore you can find pixel fonts like 6x13 or 7x14 (I also have 8x16kana and 8x16romankana). You could stretch these Latin characters to fit into a quadratic box, then they are twice as wide as before at the same height – they're now cinemascope.

These two, Latin and Chinese, are incompatible.

--
Greetings

  Pete

What is this talk of 'release?' Klingons do not make software 'releases.'  Our software 'escapes,' leaving a bloody trail of designers and quality assurance people in its wake.




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

* Re: Display characters with a different size?
  2012-06-12 15:00         ` Peter Dyballa
@ 2012-06-12 17:02           ` XeCycle
  2012-06-12 22:11             ` Peter Dyballa
  0 siblings, 1 reply; 11+ messages in thread
From: XeCycle @ 2012-06-12 17:02 UTC (permalink / raw
  To: Peter Dyballa; +Cc: help-gnu-emacs

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

Peter Dyballa <Peter_Dyballa@Web.de> writes:

> Am 12.06.2012 um 15:38 schrieb XeCycle:
>
>> The two fonts are of different metrics.  I want to force them to
>> be same.
>
> That won't work, at least not in the way you want it to. CJK
> ideograms fit into a more quadratic ("full-width") box while
> Latin characters fit more into a rectangular box
> ("half-width"). Therefore you can find pixel fonts like 6x13 or
> 7x14 (I also have 8x16kana and 8x16romankana). You could stretch
> these Latin characters to fit into a quadratic box, then they are
> twice as wide as before at the same height – they're now
> cinemascope.
>
> These two, Latin and Chinese, are incompatible.

I know this, but I mean another problem here.  Say I have a Latin
font with width 7 and height 20, I'd like my Chinese characters
shown with width 14 and height 20.  But my Chinese font told
Emacs to display them with width 12 and height 22 --- therefore
it breaks alignment.  I want to tweak it into 14x20, but don't
know how to do that.

-- 
Carl Lei (XeCycle)
Department of Physics, Shanghai Jiao Tong University
OpenPGP public key: 7795E591
Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: Display characters with a different size?
  2012-06-12 17:02           ` XeCycle
@ 2012-06-12 22:11             ` Peter Dyballa
  2012-06-13  3:05               ` XeCycle
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Dyballa @ 2012-06-12 22:11 UTC (permalink / raw
  To: XeCycle; +Cc: help-gnu-emacs


Am 12.06.2012 um 19:02 schrieb XeCycle:

> I want to tweak it into 14x20, but don't know how to do that.


Why not use a better font? I started to look into the fonts of Mac OS X 10.6.8. The first I found is BiauKai; 6.1d3e1; 2008-08-11 from DynaLab Inc. It is missing some Latin characters to display umlauts and other accented characters, but it has Latin and Greek characters that seem to fit into the same box as Chinese ideograms. Similar, with many Japanese and Korean ideograms, are Hei Regular; 6.1d3e1; 2008-08-11 and Kai Regular; 6.1d1e1; 2008-08-18, both from Shanghai Ikarus Ltd./URW Software & Type GmbH. A bit better Heiti TC Light; 7.0d6e1; 2010-03-01 and Heiti SC Medium; 7.0d6e1; 2010-03-01, both from Changzhou SinoType Technology Co., Ltd., do appear. They have many accented Latin characters. There must be more quite complete fonts.

You don't need to use pixel based fonts from or for X11. Modern Emacsen can make use of the TrueType and OpenType font technologies – and these font formats are also supported by the X server resp. libfontconfig.

--
Greetings

  Pete     === -Q
             ==<__/% >>
_____________(_)____@_____________________________




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

* Re: Display characters with a different size?
  2012-06-12 22:11             ` Peter Dyballa
@ 2012-06-13  3:05               ` XeCycle
  0 siblings, 0 replies; 11+ messages in thread
From: XeCycle @ 2012-06-13  3:05 UTC (permalink / raw
  To: Peter Dyballa; +Cc: help-gnu-emacs

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

Peter Dyballa <Peter_Dyballa@Web.de> writes:

> Am 12.06.2012 um 19:02 schrieb XeCycle:
>
>> I want to tweak it into 14x20, but don't know how to do that.
>
> Why not use a better font? I started to look into the fonts of
> Mac OS X 10.6.8. The first I found is BiauKai; 6.1d3e1;
> 2008-08-11 from DynaLab Inc. It is missing some Latin characters
> to display umlauts and other accented characters, but it has
> Latin and Greek characters that seem to fit into the same box as
> Chinese ideograms. Similar, with many Japanese and Korean
> ideograms, are Hei Regular; 6.1d3e1; 2008-08-11 and Kai Regular;
> 6.1d1e1; 2008-08-18, both from Shanghai Ikarus Ltd./URW Software
> & Type GmbH. A bit better Heiti TC Light; 7.0d6e1; 2010-03-01 and
> Heiti SC Medium; 7.0d6e1; 2010-03-01, both from Changzhou
> SinoType Technology Co., Ltd., do appear. They have many accented
> Latin characters. There must be more quite complete fonts.

I know well that I can choose other fonts, also I know some
without this problem.  But I'm a big fan of Courier, and like the
one I use now; so I want to keep it.  I read and write Chinese
less often, just want to have them shown normally, with little
need of beauty.

> You don't need to use pixel based fonts from or for X11. Modern
> Emacsen can make use of the TrueType and OpenType font
> technologies – and these font formats are also supported by the X
> server resp. libfontconfig.

The two fonts I use now are all OpenType.

-- 
Carl Lei (XeCycle)
Department of Physics, Shanghai Jiao Tong University
OpenPGP public key: 7795E591
Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

end of thread, other threads:[~2012-06-13  3:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-10 14:02 Display characters with a different size? XeCycle
2012-06-10 16:26 ` Peter Dyballa
2012-06-11  3:57   ` XeCycle
2012-06-11 13:56     ` Peter Dyballa
2012-06-12 13:38       ` XeCycle
2012-06-12 15:00         ` Peter Dyballa
2012-06-12 17:02           ` XeCycle
2012-06-12 22:11             ` Peter Dyballa
2012-06-13  3:05               ` XeCycle
2012-06-12  3:37     ` Kevin Rodgers
2012-06-12 13:28       ` XeCycle

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.