[XeTeX] trying to enable grantha script with teckit

François Patte francois.patte at mi.parisdescartes.fr
Wed Jun 17 10:49:24 CEST 2020


Le 17/06/2020 à 02:38, Dominik Wujastyk a écrit :
> Hi, Francois,
> 
> Could you send this group a MWE tex file and your hacked map file?  

I attach the map file.

MWE (not working in fact!)

<----------------

\documentclass[11pt]{report}
\usepackage{fontspec}

\fontspec{Noto Serif Grantha}

\setmainfont[%
Mapping=velthuis-sanskrit-grantha,%
% Script=Grantha,%
]{%
  Noto Serif Grantha%
}%

\newfontfamily{\grantha}{Noto Serif Grantha}

\begin{document}

{\grantha

  a aa i ii u uu .r .R k ka kaa khi khii gu guu gh.r gh.R

  atha trairaa"sike kara.nasuutrav.rttam---
}

\end{document}



> Did
> you rehash your TeX files index after adding the new map file?

I tried two ways: 1) put the .tec file in the working directory 2) put
it in /opt/texlive/texmf-local/fonts/misc/xetex/fontmapping/ then I did
mktexlsr

Best regards.

François
-- 
François Patte
UFR de mathématiques et informatique
Laboratoire CNRS MAP5, UMR 8145
Université Paris Descartes
45, rue des Saints Pères
F-75270 Paris Cedex 06
Tél. +33 (0)6 7892 5822
http://www.math-info.univ-paris5.fr/~patte
FSF
https://www.fsf.org/blogs/community/presenting-shoetool-happy-holidays-from-the-fsf
-------------- next part --------------
; $Id: velthuis-sanskrit.map,v 1.3 2012-03-10 11:40:17 icebearsoft Exp $
; TECkit mapping for conversion of Velthuis transliteration
; into UTF-8 directly by XeTeX.
; Viramas are added after the final consonant.
; Rules from tex-text.map and devanagarinumerals.map are included.
LHSName  "Velthuis-sanskrit-grantha"
RHSName  "UNICODE"
LHSDescription "Velthuis Grantha for Sanskrit"
Version  "1"
Contact  "http://devnag.sarovar.org"



Define a U+0061  ;a
Define b U+0062  ;b
Define c U+0063  ;c
Define d U+0064  ;d
Define e U+0065  ;e
Define f U+0066  ;f
Define g U+0067  ;g
Define h U+0068  ;h
Define i U+0069  ;i
Define j U+006A  ;j
Define k U+006B  ;k
Define l U+006C  ;l
Define m U+006D  ;m
Define n U+006E  ;n
Define o U+006F  ;o
Define p U+0070  ;p
Define q U+0071  ;q
Define r U+0072  ;r
Define s U+0073  ;s
Define t U+0074  ;t
Define u U+0075  ;u
Define v U+0076  ;v
Define w U+0077  ;w
Define x U+0078  ;x
Define y U+0079  ;y
Define z U+007A  ;z
Define A U+0041  ;A
Define B U+0042  ;B
Define C U+0043  ;C
Define D U+0044  ;D
Define G U+0047  ;G
Define I U+0049  ;I
Define J U+004A  ;J
Define K U+004B  ;K
Define L U+004C  ;L
Define M U+004d  ;M
Define P U+0050  ;P
Define R U+0052  ;R
Define T U+0054  ;T
Define U U+0055  ;U

Define quot	U+0022
Define hash	U+0023
Define amper	U+0026
Define plus	U+002B
Define dot	U+002E
;;Define slash	U+002F
Define at	U+0040
Define under	U+005F
Define lbrace	U+007B
Define bar	U+007C
Define rbrace	U+007D
Define tlde	U+007E

Define candrabindu U+11301 ;𑌁
Define bindu	U+0902 
Define visarga	U+11303 ; 𑌃
Define asvara	U+11305 ; 𑌅
Define Asvara	U+11306 ; 𑌆
Define isvara	U+11307 ; 𑌇
Define Isvara	U+11308 ; 𑌈
Define usvara	U+11309 ; 𑌉
Define Usvara	U+1130a ; 𑌊
Define rvoc	U+1130b ; 𑌋
Define lvoc	U+1130c ; 𑌌
Define esvara	U+1130f ; 𑌏
Define aisvara	U+11310 ; 𑌐
;;Define ocandra	U+0911
Define osvara	U+11313 ; 𑌓
Define ausvara	U+11314 ; 𑌔
Define ka	U+11315 ; 𑌕
Define kha	U+11316 ; 𑌖
Define ga	U+11317 ; 𑌗
Define gha	U+11318 ; 𑌘
Define nga	U+11319 ; 𑌙
Define ca	U+1131a ; 𑌚
Define cha	U+1131b ; 𑌛
Define ja	U+1131c ; 𑌜
Define jha	U+1131d ; 𑌝
Define nya	U+1131e ; 𑌞
Define Ta	U+1131f ; 𑌟
Define Tha	U+11320 ; 𑌠
Define Da	U+11321 ; 𑌡
Define Dha	U+11322 ; 𑌢
Define Na	U+11323 ; 𑌣
Define ta	U+11324 ; 𑌤
Define tha	U+11325 ; 𑌥
Define da	U+11326 ; 𑌦
Define dha	U+11327 ; 𑌧
Define na	U+11328 ; 𑌨
Define pa	U+1132a ; 𑌪
Define pha	U+1132b ; 𑌫
Define ba	U+1132c ; 𑌬
Define bha	U+1132d ; 𑌭
Define ma	U+1132e ; 𑌮
Define ya	U+1132f ; 𑌯
Define ra	U+11330 ; 𑌰
Define la	U+11332 ; 𑌲
Define La	U+11333 ; 𑌳
Define va	U+11335 ; 𑌵
Define sha	U+11336 ; 𑌶
Define Sa	U+11337 ; 𑌷
Define sa	U+11338 ; 𑌸
Define ha	U+11339 ; 𑌹
Define avagraha	U+1133d ; 𑌽
Define Amatra	U+1133e ; 𑌾
Define imatra	U+1133f ; 𑌿
Define Imatra	U+11340 ; 𑍀
Define umatra	U+11341 ; 𑍁
Define Umatra	U+11342 ; 𑍂
Define rmatra	U+11343 ; 𑍃
Define Rmatra	U+11344 ; 𑍄
Define ematra	U+11347 ; 𑍇
Define aimatra	U+11348 ; 𑍈
;;Define ocmatra	U+
Define omatra	U+1134B ; 𑍋
Define aumatra	U+1134C ; 𑍌
Define virama	U+1134D ; 𑍍
Define aum	U+11350 ; 𑍐
;;Define qa	U+0958 
;;Define khha	U+0959
;;Define ghha	U+095A
;;Define za	U+095B
;;Define Ra	U+095C 
;;Define Rha	U+095D
;;Define fa	U+095E
Define Rvoc	U+11360 ; 𑍠
Define Lvoc	U+11361 ; 𑍡
Define lmatra	U+11362 ; 𑍢
Define Lmatra	U+11363 ; 𑍣
Define danda	U+0964 ; ।
Define dbldanda	U+0965 ; ॥
Define abbrev	U+0970 ; ॰

Define zwnj	U+200C
Define zwj	U+200D

;; First pass
pass(Unicode)
; From TeX-text
U+002D U+002D                   <>      U+2013  ; -- -> en dash
U+002D U+002D U+002D    <>      U+2014  ; --- -> em dash
                                                                                
U+0027                  <>      U+2019  ; ' -> right single quote
U+0027 U+0027   <>      U+201D  ; '' -> right double quote
U+0022                   >      U+201D  ; " -> right double quote
                                                                                
U+0060                  <>      U+2018  ; ` -> left single quote
U+0060 U+0060   <>      U+201C  ; `` -> left double quote

; Numerals
U+0030	>	U+0be6 ; ௦ 
U+0031	>	U+0be7 ; ௧
U+0032	>	U+0be8 ; ௨
U+0033	>	U+0be9 ; ௩
U+0034	>	U+0bea ; ௪
U+0035	>	U+0beb ; ௫
U+0036	>	U+0bec ; ௬
U+0037	>	U+0bed ; ௭
U+0038	>	U+0bee ; ௮
U+0039	>	U+0bef ; ௯

; Vowels, all independent
a <> asvara
a a > Asvara
a a a > Asvara
a a a a > Asvara
A <> Asvara
i <> isvara
i i > Isvara
i i i > Isvara
i i i i> Isvara
I <> Isvara
u <> usvara
u u > Usvara
u u u > Usvara
u u u u > Usvara
U <> Usvara
dot r <> rvoc
dot R <> Rvoc
dot l <> lvoc
dot L <> Lvoc
e <> esvara
a i <> aisvara
o <> osvara
a u <> ausvara
M <> bindu
dot m > bindu
tlde m <> candrabindu
;;slash > candrabindu
dot h <> visarga
under <> virama
amper > virama
dot a <> avagraha
;;tlde o <> ocandra
dot o <> aum

; Consonants, no conjuncts
k <> ka
k h <> kha
K > kha
g <> ga
g h <> gha
G > gha
quot n <> nga
;;q <> qa
;;dot k h <> khha
;;dot g <> ghha
c <> ca
c h <> cha
C > cha
j <> ja
j h <> jha
J > jha
tlde n <> nya
;;z <> za
dot t <> Ta
dot t h <> Tha
dot T > Tha
dot d <> Da
dot d h <> Dha
dot D > Dha
dot n <> Na
;;R <> Ra
;;R h <> Rha
t <> ta
t h <> tha
T > tha
d <> da
d h <> dha
D > dha
n <> na
p <> pa
p h <> pha
P > pha
b <> ba
b h <> bha
B > bha
m <> ma
;;f <> fa
y <> ya
r <> ra
l <> la
v <> va
L <> La
quot s <> sha
dot s <> Sa
s <> sa
h <> ha
; Symbols
at <> abbrev
bar <> danda

; Ligature breaking
plus <> zwj

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
pass (Unicode)

UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc Lvoc esvara aisvara \
                osvara  ausvara)
UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra Lmatra ematra \
                 aimatra omatra aumatra)


([matra]|[svara]) ra rvoc <> ([matra]|[svara]) ra virama rvoc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;




;; Second pass: converting vowels + a few simple rules
pass (Unicode)

;; Classes
UniClass [vyanjana] = (ka .. ha)
UniClass [svara] = (Asvara isvara Isvara usvara Usvara rvoc Rvoc lvoc Lvoc esvara aisvara \
                 osvara ausvara)
UniClass [matra] = (Amatra imatra Imatra umatra Umatra rmatra Rmatra lmatra Lmatra ematra \
                 aimatra omatra aumatra)


[vyanjana] [svara] <> [vyanjana] [matra]
[vyanjana] zwj <> [vyanjana] virama zwj
danda danda <> dbldanda

;; Third pass: making conjuncts
pass (Unicode)

;; Classes
UniClass [vyanjana] = (ka .. ha)

[vyanjana]=v1 [vyanjana]=v2 <> @v1 virama @v2

;; Fourth pass: making remaining conjuncts (for groups of two or more consonants)
;; and adding viramas to the end of the words in Sanskrit
pass (Unicode)

;; Classes
UniClass [vyanjana] = (ka .. ha)
UniClass [spacepunct] = (U+0009 .. U+0040 U+005B .. U+0060 U+007B .. U+007D danda dbldanda \
    U+2013 U+2014 U+2018 U+2019 U+201C U+201D)

[vyanjana]=v1 [vyanjana]=v2 <> @v1 virama @v2
[vyanjana] / _ [spacepunct] <> [vyanjana] virama / _ [spacepunct]
[vyanjana] / _ # <> [vyanjana] virama / _ #

;; Fifth pass: removing inherent "a"
pass (Unicode)

;; Classes
UniClass [vyanjana] = (ka .. ha)

[vyanjana] asvara <> [vyanjana]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <https://tug.org/pipermail/xetex/attachments/20200617/2d600579/attachment.sig>


More information about the XeTeX mailing list.