From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/84211 Path: news.gmane.org!not-for-mail From: Peter Graif Newsgroups: gmane.comp.tex.context Subject: Re: devanagari rendering (2 errors) Date: Tue, 10 Sep 2013 11:44:43 -0400 Message-ID: <40D73217-E059-4C04-8CA5-4B7003282FD9@gmail.com> References: <522E4A21.2090905@wxs.nl> <7FE3820F-56A9-4628-9447-E2C1DE305C72@gmail.com> <522F0AB9.5090301@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1378827897 22691 80.91.229.3 (10 Sep 2013 15:44:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Sep 2013 15:44:57 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 10 17:44:59 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VJQ7f-0005Wd-Hp for gctc-ntg-context-518@m.gmane.org; Tue, 10 Sep 2013 17:44:59 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 16F111021C; Tue, 10 Sep 2013 17:43:17 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id n+Zy5Ej+yG8i; Tue, 10 Sep 2013 17:43:11 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 43323101EB; Tue, 10 Sep 2013 17:43:11 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 22A23101EB for ; Tue, 10 Sep 2013 17:43:10 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id EUiB5JpM9R9R for ; Tue, 10 Sep 2013 17:43:05 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 4A8D0101E5 for ; Tue, 10 Sep 2013 17:43:05 +0200 (CEST) Original-Received: from mail-oa0-x22f.google.com (mail-oa0-x22f.google.com [IPv6:2607:f8b0:4003:c02::22f]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r8AFijg0023222 for ; Tue, 10 Sep 2013 17:44:46 +0200 Original-Received: by mail-oa0-f47.google.com with SMTP id g12so8114927oah.34 for ; Tue, 10 Sep 2013 08:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=ARioiNJJMxZNJVcOUuV/2a21FTzcRf4YkW4fEqwW+T0=; b=1FFBKHBgAIx/Bpx0IE3Qb6LrTGPOOHiXp/DXFThff5murE61q+G4zTOK3YI0w7d8VM sNy+ZQpNvIeKdfOFXrPH3n+GAhdquTk+2OOifqSD9V796YGeaH0vtISsaHCRQGHdtUQ+ XbXipdz/Y64s3Rj4W2W51eXuYXtneTXWTZ8D17AanN12PE8jagj/8vTrny+iid0yIB2l nZ1puzpnbfptEXZgDBrgcMv/vazn6zMVfMJbLn/ObJTN/CMEQNYyvsF3pFyoaeB8LBgG +vw+ExNXnG/L5dXN9ryoe2mkh6YiP042AC0GRnU5oLv1EagjrNJxTfEI9GthjA75EYiD DjXA== X-Received: by 10.182.61.44 with SMTP id m12mr3377645obr.52.1378827885563; Tue, 10 Sep 2013 08:44:45 -0700 (PDT) Original-Received: from [192.168.1.81] (75-39-97-39.lightspeed.bcwdoh.sbcglobal.net. [75.39.97.39]) by mx.google.com with ESMTPSA id nw5sm21000175obc.9.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 08:44:44 -0700 (PDT) In-Reply-To: <522F0AB9.5090301@wxs.nl> X-Mailer: Apple Mail (2.1508) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2607:f8b0:4003:c02::22f; country=US X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03KnrIKvu - fa52c3475312 - 20130910 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:84211 Archived-At: > it took me quite a while to notice that it's a side effect of two features that are turned on > > you can play with > > \definefontfeature > [devanagari-one] > [devanagari-one] > [rphf=no] > > and > > \definefontfeature > [devanagari-one] > [devanagari-one] > [half=no] > > maybe Kai can have a look at it: as these are dealt with in a different we probably don't need to enable them in the feature processor (even block them) > > btw, you can play with > > \showotfcomposition{file:chandas.ttf*devanagari-one}{l2r}{\char"0915 \char"094D \char"0930} > > to see what happens > > (i also noticed a few possible further optimizations but that's for later) > > Hans Thanks, Hans. Those are indeed the relevant features. Unfortunately, turning them off completely breaks other things. I have attached another demonstration below. The good news is that we can now produce proper devanagari by switching the features on and off as needed in the middle of words. I am understanding OpenType better now and I will try again to look at the relevant source code tonight. -Peter -------------------------- \definefontfeature[devyes][devanagari-one][rphf=yes,half=yes] \definefontfeature[devno][devanagari-one][rphf=no,half=no] \definefont [DevaWith] [file:chandas.ttf*devyes at 14pt] \definefont [DevaWithout] [file:chandas.ttf*devno at 14pt] \starttext {\bf When rphf=yes (current default)} r-first conjucts ([r]+[half]+\{consonant\}) work: {\DevaWith [U+0930 \char"0930][U+094D \char"094D][U+0915 \char"0915]: \char"0930 \char"094D \char"0915 ~(correct)} but r-second conjucts (\{consonant\} +[half]+[r]) don't: {\DevaWith [U+0915 \char"0915][U+094D \char"094D][U+0930 \char"0930]: \char"0915 \char"094D \char"0930 ~(incorrect)} \blank[big] {\bf When rphf=no} r-first conjucts ([r]+[half]+\{consonant\}) stop working: {\DevaWithout [U+0930 \char"0930][U+094D \char"094D][U+0915 \char"0915]: \char"0930 \char"094D \char"0915 ~(incorrect)} but r-second conjucts (\{consonant\} +[half]+[r]) now work properly: {\DevaWithout [U+0915 \char"0915][U+094D \char"094D][U+0930 \char"0930]: \char"0915 \char"094D \char"0930 ~(correct)} \blank[3*big] {\bf When half=yes (current default)} consonant clusters (\{consonant\}+[half]+\{consonant\}) work: {\DevaWith [U+0915 \char"0915][U+094D \char"094D][U+0915 \char"0915]: \char"0915 \char"094D \char"0915 ~(correct)} but word-final viramas (\{consonant\} +[half]) don't: {\DevaWith [U+0915 \char"0915][U+094D \char"094D] : \char"0915 \char"094D ~(incorrect)} \blank[big] {\bf When half=no} consonant clusters (\{consonant\}+[half]+\{consonant\}) stop working: {\DevaWithout [U+0915 \char"0915][U+094D \char"094D][U+0915 \char"0915]: \char"0915 \char"094D \char"0915 ~(incorrect)} but word-final viramas (\{consonant\} +[half]) work properly: {\DevaWithout [U+0915 \char"0915][U+094D \char"094D] : \char"0915 \char"094D ~(correct)} \blank[2*big] With careful bracketing, it's possible to produce correct devanagari. On: {\DevaWith \char"092E\char"0915\char"094D\char"0915\char"092E\char"0915\char"094D} (no good) Off: {\DevaWithout \char"092E\char"0915\char"094D\char"0915\char"092E\char"0915\char"094D} (no good) Mixed: {\DevaWith \char"092E\char"0915\char"094D\char"0915\char"092E{\DevaWithout \char"0915\char"094D}} (perfect) That's not sustainable for long texts, perhaps, but it's a great move in that direction. \blank[big] Note: I've used the consonant [U+0915: {\DevaWith \char"0915}] here throughout, but you can substitute any consonant \{U+0915--U+0939, U+0958--U+095F\} and see the same patterns. \stoptext ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________