Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ad11ca0 authored by Deepanshu Gupta's avatar Deepanshu Gupta Committed by Android Git Automerger
Browse files

am e3e1591c: Merge "Remove lxml dependency." into lmp-preview-dev

* commit 'e3e1591cd8d748ba5da228fe857dd785ec7965a9':
  Remove lxml dependency.
parents 6370c7f5 352d84fb
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -27,7 +27,7 @@ import sys
from fontTools import ttx
from fontTools import ttx
import re
import re
import os
import os
from lxml import etree
import xml.etree.ElementTree as etree
import shutil
import shutil
import glob
import glob
from multiprocessing import Pool
from multiprocessing import Pool
@@ -84,14 +84,13 @@ def convert_font(input_path):
    ttx.main(ttx_args)
    ttx.main(ttx_args)
    # now parse the xml file to change its PS name.
    # now parse the xml file to change its PS name.
    tree = etree.parse(ttx_path)
    tree = etree.parse(ttx_path)
    encoding = tree.docinfo.encoding
    root = tree.getroot()
    root = tree.getroot()
    for name in root.iter('name'):
    for name in root.iter('name'):
      [old_ps_name, version] = get_font_info(name)
      [old_ps_name, version] = get_font_info(name)
      if old_ps_name is not None and version is not None:
      if old_ps_name is not None and version is not None:
        new_ps_name = old_ps_name + version
        new_ps_name = old_ps_name + version
        update_name(name, new_ps_name)
        update_name(name, new_ps_name)
    tree.write(ttx_path, xml_declaration=True, encoding=encoding )
    tree.write(ttx_path, xml_declaration=True, encoding='utf-8' )
    # generate the udpated font now.
    # generate the udpated font now.
    ttx_args = ['-q', '-d', dest_dir, ttx_path]
    ttx_args = ['-q', '-d', dest_dir, ttx_path]
    ttx.main(ttx_args)
    ttx.main(ttx_args)
+1 −1
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@ import build_font


from fontTools import ttx
from fontTools import ttx
import os
import os
from lxml import etree
import xml.etree.ElementTree as etree
import shutil
import shutil
import tempfile
import tempfile