Hans Hagen wrote:
Oleg Kolosov wrote:
Hello!
I'm trying to generate searchable pdf with cyrrillic glyphs with the
following:
\enableregime[utf]
\mainlanguage[ru]
\setupencoding[default=t2a]
\useencoding[pfr]
\usepdffontresource t2a
\usetypescript[pscyr][\defaultencoding] % type-pscyr is my own
typescript file
\setupbodyfont[pscyr,14pt]
also tried with:
\startencoding[t2a]
\usepdffontresource t2a
\stopencoding
It seems that \usepdffontresource does nothing. I see pdfr-def loaded in
log, but not pdfr-t2a. \input pdfr-t2a (or pdfr-ec) says that
\startpdffontresource is undefined command. I've created pdfr-t2a.tex by
replacing definitions in pdfr-ec with ones from cmap latex package
(found in file t2a.cmap). I'm using ConTeXt mkII since mkIV is in active
development. Tried also with ec as default encoding with the same result
(pdfr-ec.tex is not loaded).
Please help me create header for minimal file which will generate
searchable PDF.
pdftex does it itself (i.e. create the vectors) using pdfr-def.tex
(unless i did something wrong)
Hans
It's unlikely. I've tested it with minimal file and english text is
indeed searchable, but cyrillic is not, with copy-paste I get some
strange symbols. I'm using type1 fonts from PSCyr package with my own
typescript, does this matter? I've attached typescript file just in
case (it's still incomplete but works fine for me). Maybe I miss some
definition or option? BTW cyrillic in PDF TOC works fine (with inclusion
of spec-tst.tex).
Minimal file which I've used for testing:
\enableregime[utf]
\mainlanguage[ru]
\usetypescript[pscyr][t2a]
\setupbodyfont[pscyr]
\starttext
Some text to test PDF search. Немного текста для тестирования.
\stoptext
Thanks for your time.
--
Best Regards,
Oleg Kolosov
% ConTeXt typescript file for use with the PSCyr font package
% Version: 0.3.1
\starttypescriptcollection [pscyr]
\starttypescript [map] [pscyr] [t2a]
\loadmapfile [pscyr.map]
\stoptypescript
% Academy
\starttypescript [serif] [academy] [name]
\setups [font:fallback:serif]
\definefontsynonym [Serif] [AcademyPSCyr-Regular]
\definefontsynonym [SerifBold] [AcademyPSCyr-Bold]
\definefontsynonym [SerifItalic] [AcademyPSCyr-Italic]
\definefontsynonym [SerifSlanted] [AcademyPSCyr-Slanted]
\definefontsynonym [SerifBoldItalic] [AcademyPSCyr-BoldSlanted]
\definefontsynonym [SerifBoldSlanted] [AcademyPSCyr-BoldSlanted]
\definefontsynonym [SerifCaps] [AcademyPSCyr-SmallCaps]
\stoptypescript
\starttypescript [serif] [academy] [t2a]
\definefontsynonym [AcademyPSCyr-Regular] [facr6t] [encoding=\typescriptthree]
\definefontsynonym [AcademyPSCyr-Bold] [facb6t] [encoding=\typescriptthree]
\definefontsynonym [AcademyPSCyr-Italic] [facri6t] [encoding=\typescriptthree]
\definefontsynonym [AcademyPSCyr-Slanted] [facro6t] [encoding=\typescriptthree]
\definefontsynonym [AcademyPSCyr-BoldSlanted] [facbo6t] [encoding=\typescriptthree]
\definefontsynonym [AcademyPSCyr-SmallCaps] [facrc6t] [encoding=\typescriptthree]
\stoptypescript
% Antiqua
\starttypescript [serif] [antiqua] [name]
\setups [font:fallback:serif]
\definefontsynonym [Serif] [AntiquaPSCyr-Regular]
\definefontsynonym [SerifBold] [AntiquaPSCyr-Bold]
\definefontsynonym [SerifItalic] [AntiquaPSCyr-Italic]
\definefontsynonym [SerifSlanted] [AntiquaPSCyr-Slanted]
\definefontsynonym [SerifBoldItalic] [AntiquaPSCyr-BoldItalic]
\definefontsynonym [SerifBoldSlanted] [AntiquaPSCyr-BoldSlanted]
\definefontsynonym [SerifCaps] [AntiquaPSCyr-SmallCaps]
\stoptypescript
\starttypescript [serif] [antiqua] [t2a]
\definefontsynonym [AntiquaPSCyr-Regular] [faqr6t] [encoding=\typescriptthree]
\definefontsynonym [AntiquaPSCyr-Bold] [faqb6t] [encoding=\typescriptthree]
\definefontsynonym [AntiquaPSCyr-Italic] [faqri6t] [encoding=\typescriptthree]
\definefontsynonym [AntiquaPSCyr-Slanted] [faqro6t] [encoding=\typescriptthree]
\definefontsynonym [AntiquaPSCyr-BoldItalic] [faqbi6t] [encoding=\typescriptthree]
\definefontsynonym [AntiquaPSCyr-BoldSlanted] [faqbo6t] [encoding=\typescriptthree]
\definefontsynonym [AntiquaPSCyr-SmallCaps] [faqrc6t] [encoding=\typescriptthree]
\stoptypescript
% Handbook
\starttypescript [serif] [handbook] [t2a]
\definefontsynonym [HandbookPSCyr-Regular] [fhar6t] [encoding=\typescriptthree]
\definefontsynonym [HandbookPSCyr-Bold] [fhab6t] [encoding=\typescriptthree]
\definefontsynonym [HandbookPSCyr-Italic] [fhari6t] [encoding=\typescriptthree]
\definefontsynonym [HandbookPSCyr-Slanted] [fharo6t] [encoding=\typescriptthree]
\definefontsynonym [HandbookPSCyr-BoldSlanted] [fhabo6t] [encoding=\typescriptthree]
\stoptypescript
% College
\starttypescript [serif] [college] [t2a]
\definefontsynonym [CollegePSCyr-Regular] [fcor6t] [encoding=\typescriptthree]
\definefontsynonym [CollegePSCyr-Bold] [fcob6t] [encoding=\typescriptthree]
\definefontsynonym [CollegePSCyr-Italic] [fcori6t] [encoding=\typescriptthree]
\definefontsynonym [CollegePSCyr-Slanted] [fcoro6t] [encoding=\typescriptthree]
\definefontsynonym [CollegePSCyr-BoldSlanted] [fcobo6t] [encoding=\typescriptthree]
\stoptypescript
% Journal
\starttypescript [serif] [journal] [t2a]
\definefontsynonym [JournalPSCyr-Regular] [fjnr6t] [encoding=\typescriptthree]
\definefontsynonym [JournalPSCyr-Bold] [fjnb6t] [encoding=\typescriptthree]
\definefontsynonym [JournalPSCyr-Italic] [fjnri6t] [encoding=\typescriptthree]
\definefontsynonym [JournalPSCyr-Slanted] [fjnro6t] [encoding=\typescriptthree]
\definefontsynonym [JournalPSCyr-BoldSlanted] [fjnbo6t] [encoding=\typescriptthree]
\stoptypescript
% Lazurski
\starttypescript [serif] [lazurski] [t2a]
\definefontsynonym [LazurskiPSCyr-Regular] [flzr6t] [encoding=\typescriptthree]
\definefontsynonym [LazurskiPSCyr-Slanted] [flzro6t] [encoding=\typescriptthree]
\stoptypescript
% Souvenir
\starttypescript [serif] [souvenir] [t2a]
\definefontsynonym [SouvenirPSCyr-Regular] [fsvr6t] [encoding=\typescriptthree]
\definefontsynonym [SouvenirPSCyr-Bold] [fsvb6t] [encoding=\typescriptthree]
\definefontsynonym [SouvenirPSCyr-Slanted] [fsvro6t] [encoding=\typescriptthree]
\definefontsynonym [SouvenirPSCyr-BoldSlanted] [fsvbo6t] [encoding=\typescriptthree]
\stoptypescript
% TimesNewRomanPSMT
\starttypescript [serif] [times] [name]
\setups [font:fallback:serif]
\definefontsynonym [Serif] [TimesNewRomanPSMT-Regular]
\definefontsynonym [SerifBold] [TimesNewRomanPSMT-Bold]
\definefontsynonym [SerifItalic] [TimesNewRomanPSMT-Italic]
\definefontsynonym [SerifSlanted] [TimesNewRomanPSMT-Slanted]
\definefontsynonym [SerifBoldItalic] [TimesNewRomanPSMT-BoldItalic]
\definefontsynonym [SerifBoldSlanted] [TimesNewRomanPSMT-BoldSlanted]
\definefontsynonym [SerifCaps] [TimesNewRomanPSMT-SmallCaps]
\stoptypescript
\starttypescript [serif] [times] [t2a]
\definefontsynonym [TimesNewRomanPSMT-Regular] [ftmr6t] [encoding=\typescriptthree]
\definefontsynonym [TimesNewRomanPSMT-Bold] [ftmb6t] [encoding=\typescriptthree]
\definefontsynonym [TimesNewRomanPSMT-Italic] [ftmri6t] [encoding=\typescriptthree]
\definefontsynonym [TimesNewRomanPSMT-Slanted] [ftmro6t] [encoding=\typescriptthree]
\definefontsynonym [TimesNewRomanPSMT-BoldItalic] [ftmbi6t] [encoding=\typescriptthree]
\definefontsynonym [TimesNewRomanPSMT-BoldSlanted] [ftmbo6t] [encoding=\typescriptthree]
\definefontsynonym [TimesNewRomanPSMT-SmallCaps] [ftmrc6t] [encoding=\typescriptthree]
\stoptypescript
% ArialMT
\starttypescript [sans] [arial] [t2a]
\definefontsynonym [ArialMT-Regular] [farr6t] [encoding=\typescriptthree]
\definefontsynonym [ArialMT-Bold] [farb6t] [encoding=\typescriptthree]
\definefontsynonym [ArialMT-Italic] [farri6t] [encoding=\typescriptthree]
\definefontsynonym [ArialMT-BoldItalic] [farbi6t] [encoding=\typescriptthree]
\definefontsynonym [ArialMT-Slanted] [farro6t] [encoding=\typescriptthree]
\definefontsynonym [ArialMT-BoldSlanted] [farbo6t] [encoding=\typescriptthree]
\definefontsynonym [ArialMT-Black] [farbe6t] [encoding=\typescriptthree]
\stoptypescript
% Textbook
\starttypescript [sans] [textbook] [name]
\setups [font:fallback:sans]
\definefontsynonym [Sans] [TextbookPSCyr-Regular]
\definefontsynonym [SansBold] [TextbookPSCyr-Bold]
\definefontsynonym [SansItalic] [TextbookPSCyr-Italic]
\definefontsynonym [SansSlanted] [TextbookPSCyr-Slanted]
\definefontsynonym [SansBoldItalic] [TextbookPSCyr-BoldSlanted]
\definefontsynonym [SansCaps] [TextbookPSCyr-SmallCaps]
\stoptypescript
\starttypescript [sans] [textbook] [t2a]
\definefontsynonym [TextbookPSCyr-Regular] [ftxr6t] [encoding=\typescriptthree]
\definefontsynonym [TextbookPSCyr-Bold] [ftxb6t] [encoding=\typescriptthree]
\definefontsynonym [TextbookPSCyr-Italic] [ftxri6t] [encoding=\typescriptthree]
\definefontsynonym [TextbookPSCyr-Slanted] [ftxro6t] [encoding=\typescriptthree]
\definefontsynonym [TextbookPSCyr-BoldSlanted] [ftxbo6t] [encoding=\typescriptthree]
\definefontsynonym [TextbookPSCyr-SmallCaps] [ftxrc6t] [encoding=\typescriptthree]
\stoptypescript
% Magazine
\starttypescript [sans] [magazine] [t2a]
\definefontsynonym [MagazinePSCyr-Regular] [fmar6t] [encoding=\typescriptthree]
\definefontsynonym [MagazinePSCyr-Bold] [fmab6t] [encoding=\typescriptthree]
\definefontsynonym [MagazinePSCyr-Italic] [fmari6t] [encoding=\typescriptthree]
\definefontsynonym [MagazinePSCyr-Slanted] [fmaro6t] [encoding=\typescriptthree]
\definefontsynonym [MagazinePSCyr-BoldSlanted] [fmabo6t] [encoding=\typescriptthree]
\stoptypescript
% CourierNewPSMT
\starttypescript [mono] [courier] [t2a]
\definefontsynonym [CourierNewPSMT-Regular] [fcrr6t] [encoding=\typescriptthree]
\definefontsynonym [CourierNewPSMT-Bold] [fcrb6t] [encoding=\typescriptthree]
\definefontsynonym [CourierNewPSMT-Italic] [fcrri6t] [encoding=\typescriptthree]
\definefontsynonym [CourierNewPSMT-BoldItalic] [fcrbi6t] [encoding=\typescriptthree]
\stoptypescript
% ERKurier
\starttypescript [mono] [erkurier] [name]
\setups [font:fallback:mono]
\definefontsynonym [Mono] [ERKurierPSCyr-Regular]
\definefontsynonym [MonoBold] [ERKurierPSCyr-Bold]
\definefontsynonym [MonoItalic] [ERKurierPSCyr-Italic]
\definefontsynonym [MonoBoldItalic] [ERKurierPSCyr-BoldItalic]
\stoptypescript
\starttypescript [mono] [erkurier] [t2a]
\definefontsynonym [ERKurierPSCyr-Regular] [ferr6t] [encoding=\typescriptthree]
\definefontsynonym [ERKurierPSCyr-Bold] [ferb6t] [encoding=\typescriptthree]
\definefontsynonym [ERKurierPSCyr-Italic] [ferri6t] [encoding=\typescriptthree]
\definefontsynonym [ERKurierPSCyr-BoldItalic] [ferbi6t] [encoding=\typescriptthree]
\stoptypescript
% Math
\starttypescript [math] [antiqua] [name]
\definefontsynonym [MathRoman] [faqr7t]
\definefontsynonym [MathItalic] [zfaqcmrm]
\definefontsynonym [MathRomanBold] [faqb7t]
\definefontsynonym [MathItalicBold] [zfaqcmbm]
\stoptypescript
% Typefaces
\starttypescript [pscyr] [t2a]
\definetypeface [pscyr] [rm] [serif] [antiqua] [default] [encoding=\typescripttwo]
\definetypeface [pscyr] [ss] [sans] [textbook] [default] [encoding=\typescripttwo]
\definetypeface [pscyr] [tt] [mono] [erkurier] [default] [encoding=\typescripttwo]
\definetypeface [pscyr] [mm] [math] [antiqua] [default] [encoding=\typescripttwo]
\definetypeface [pscyr-times] [rm] [serif] [times] [default] [encoding=\typescripttwo]
\definetypeface [pscyr-times] [ss] [sans] [textbook] [default] [encoding=\typescripttwo]
\definetypeface [pscyr-times] [tt] [mono] [erkurier] [default] [encoding=\typescripttwo]
\definetypeface [pscyr-times] [mm] [math] [antiqua] [default] [encoding=\typescripttwo]
\stoptypescript
\stoptypescriptcollection
___________________________________________________________________________________
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
___________________________________________________________________________________