ó LzñWc@smdZddlZddlZddlZddlmZmZddlm Z m Z ddd„ƒYZ dS(sË Provide an encoder for a font specification configuration: the encoder is fed with Unicode characters one by one and determines the needed font switches between the preceding and the current character. iÿÿÿÿN(tFcFallbackFontSpectDefaultFontSpec(tFontSpect_indenttFontSpecConfigcBs)eZdZd„Zd„Zd„ZRS(s‹ This object parses an XML fontspec configuration file and build the resulting fontspec tree, the root fontspec being the default font to apply. The fontspec configuration file defines the fonts to apply in order of precedence (and for some Unicode ranges) and the font levels (or subfonts) thanks to the 'refmode' attribute that links a font to its parent. cCs>tjdƒ|_g|_i|_tjjj|ƒ}xÒ|j dƒD]Á}|j dƒ}|r¶|jj dƒ|j dƒ}|dkržt ƒ|_ n tƒ|_ |j }n tƒ}|j|ƒ||j krî|jj|ƒn|jrI||j|j s