From: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: XeConTeXt bug report I: strange benchmark
Date: Wed, 13 May 2009 11:55:49 +0200 [thread overview]
Message-ID: <6faad9f00905130255h7a98b6a1ta756cd3e42674ecd@mail.gmail.com> (raw)
In-Reply-To: <6faad9f00905130159n6128e355tc22a71a5ba740e7a@mail.gmail.com>
On Wed, May 13, 2009 at 10:59, Mojca Miklavec wrote:
>
> I suspect that what LaTeX does is something similar to the following
> (in ConTeXt slang):
>
> \starttypescript[cjk] [zhfont]
> \definefontsynonym [CJK] [file:SimSun]
> \definefontsynonym [CJKBold] [file:SimSun] % you could
> artificially embolden the font
> \definefontsynonym [CJKItalic] [file:SimSun] % you could
> artificially slant the font
> \definefontsynonym [CJKBoldItalic] [file:SimSun]
> \stoptypescript
>
>
> \definetypeface [myzhfont] [rm] [serif] [latin-modern] [default]
> \definetypeface [myzhfont] [ss] [sans] [latin-modern] [default]
> \definetypeface [myzhfont] [tt] [mono] [latin-modern] [default]
> \definetypeface [myzhfont] [cjk] [cjk] [zhfont] [default]
>
> \dorecurse{10000}{ hello {\cjk 你好 \it 你好}}
>
> In a similar way ConTeXt supports handwriting/calligraphy families
> (\hw, \cg I think; well, maybe you could even pretend that you are
> defining the "calligraphy font" to start with, as that one is already
> defined where it needs to be defined). If you manage to make the
> proposal above to run, this will save you the need for switching the
> whole typeface ten thousands of times and should become really fast
> (hopefully).
I tested the following, but you should compare the timing on your
machine (it's a different processor and a different font):
\starttypescript[calligraphy] [song]
\definefontsynonym [AdobeSong] [file:AdobeSongStd-Light]
\stoptypescript
\starttypescript[calligraphy] [song] [name]
\definefontsynonym [Calligraphy] [AdobeSong]
\stoptypescript
\starttypescript[zhfont]
\definetypeface [zhfont] [rm] [serif] [modern] [default]
\definetypeface [zhfont] [ss] [sans] [modern] [default]
\definetypeface [zhfont] [tt] [mono] [modern] [default]
\definetypeface [zhfont] [cg] [calligraphy] [song] [default]
\stoptypescript
\usetypescript[zhfont]
\setupbodyfont[zhfont,10pt]
\font\ccg="[AdobeSongStd-Light]"
\starttext
% test 1: takes 12 seconds
\dorecurse{10000}{ hello {\cg 你好}}
% test 2: takes 9 seconds
\dorecurse{10000}{ hello {\ccg 你好}}
\stoptext
Switching the whole typescript (\def\ccg{\zhfont} and running the
second test) took 123 seconds eating 100% of processor time.
So maybe that's the way to go, just define a calligraphy-like constant
for cjk family that will enable switching to bold/italic as well (an
equivalent to rm/ss/tt)?
Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2009-05-13 9:55 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-12 5:01 Yue Wang
2009-05-12 9:02 ` Yue Wang
2009-05-12 9:09 ` Yue Wang
2009-05-12 9:30 ` Hans Hagen
2009-05-12 9:59 ` Yue Wang
2009-05-12 10:04 ` Yue Wang
2009-05-12 10:06 ` Hans Hagen
[not found] ` <4A094C71.3040503@elvenkind.com>
2009-05-12 11:02 ` Hans Hagen
2009-05-12 11:26 ` Taco Hoekwater
2009-05-12 11:33 ` Yue Wang
2009-05-12 11:52 ` Taco Hoekwater
2009-05-12 11:57 ` Hans Hagen
2009-05-12 12:01 ` Yue Wang
2009-05-12 12:21 ` Hans Hagen
2009-05-12 12:26 ` Taco Hoekwater
2009-05-12 12:31 ` Yue Wang
2009-05-12 11:09 ` Yue Wang
2009-05-12 11:37 ` Hans Hagen
2009-05-12 12:26 ` Yue Wang
2009-05-12 12:54 ` Hans Hagen
2009-05-12 13:59 ` Yue Wang
2009-05-12 14:11 ` Yue Wang
2009-05-12 15:02 ` Hans Hagen
2009-05-12 15:12 ` Yue Wang
2009-05-12 15:22 ` Hans Hagen
2009-05-12 15:45 ` Yue Wang
2009-05-13 4:38 ` Yue Wang
2009-05-13 7:49 ` Yue Wang
2009-05-13 8:28 ` Hans Hagen
2009-05-12 15:45 ` Hans Hagen
2009-05-12 14:50 ` Hans Hagen
2009-05-12 15:10 ` Yue Wang
2009-05-12 15:14 ` Taco Hoekwater
2009-05-12 15:41 ` Hans Hagen
2009-05-12 15:49 ` Yue Wang
2009-05-12 15:20 ` Hans Hagen
2009-05-12 15:50 ` Hans Hagen
2009-05-13 8:59 ` Mojca Miklavec
2009-05-13 9:55 ` Mojca Miklavec [this message]
2009-05-13 11:12 ` Hans Hagen
2009-05-13 11:17 ` Hans Hagen
2009-05-13 10:02 ` Wolfgang Schuster
2009-05-13 10:17 ` Mojca Miklavec
2009-05-13 10:41 ` Wolfgang Schuster
2009-05-13 11:12 ` Mojca Miklavec
2009-05-13 11:28 ` Wolfgang Schuster
2009-05-13 12:48 ` Thomas A. Schmitz
2009-05-13 12:26 ` Yue Wang
2009-05-13 12:59 ` Hans Hagen
2009-05-13 13:25 ` Wolfgang Schuster
2009-05-12 11:01 ` Wolfgang Schuster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6faad9f00905130255h7a98b6a1ta756cd3e42674ecd@mail.gmail.com \
--to=mojca.miklavec.lists@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).