# HG changeset patch # User Edouard Tisserant # Date 1617091555 -7200 # Node ID 0ddefd20ca2b3c0c71ce32ab82e8500944795173 # Parent a5bca0a5eaf53c7335bd5151de5e170a210a2cbb SVGHMI: Add font management buttons and icons, doing nothing for now diff -r a5bca0a5eaf5 -r 0ddefd20ca2b images/AddFont.png Binary file images/AddFont.png has changed diff -r a5bca0a5eaf5 -r 0ddefd20ca2b images/DelFont.png Binary file images/DelFont.png has changed diff -r a5bca0a5eaf5 -r 0ddefd20ca2b images/icons.svg --- a/images/icons.svg Mon Mar 29 15:46:02 2021 +0200 +++ b/images/icons.svg Tue Mar 30 10:05:55 2021 +0200 @@ -31,8 +31,8 @@ - - + + sodipodi:cx="38.638336" /> - - + + sodipodi:cx="38.638336" /> %% Build Clean editPLC HMIEditor ImportFile ManageFolder ImportSVG NetworkEdit ShowMaster ExportSlave Run ShowIECcode Stop EditSVG OpenPOT EditPO %% + style="font-size:12.76095104px;line-height:1.25">%% Build Clean editPLC HMIEditor ImportFile ManageFolder ImportSVG NetworkEdit ShowMaster ExportSlave Run ShowIECcode Stop EditSVG OpenPOT EditPO AddFont DelFont %% + cx="0" + sodipodi:ry="226" + sodipodi:rx="226" + sodipodi:cy="0" + sodipodi:cx="0" /> + cx="0" + sodipodi:ry="169.5" + sodipodi:rx="169.5" + sodipodi:cy="0" + sodipodi:cx="0" /> - + - + + cx="0" + sodipodi:ry="106.5" + sodipodi:rx="106.5" + sodipodi:cy="0" + sodipodi:cx="0" /> - + sodipodi:cx="91.923882" /> + style="fill:#84c225;fill-rule:evenodd;stroke:#5d9d35;stroke-width:2.82220006" + sodipodi:ry="34.144001" + sodipodi:rx="34.144001" + sodipodi:cy="110.081" + sodipodi:cx="100.287" /> + + + + + + + + + + + + diff -r a5bca0a5eaf5 -r 0ddefd20ca2b svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Mon Mar 29 15:46:02 2021 +0200 +++ b/svghmi/gen_index_xhtml.xslt Tue Mar 30 10:05:55 2021 +0200 @@ -1,6 +1,6 @@ - - + + @@ -1713,7 +1713,7 @@ - + @@ -6858,7 +6858,7 @@ - + diff -r a5bca0a5eaf5 -r 0ddefd20ca2b svghmi/svghmi.py --- a/svghmi/svghmi.py Mon Mar 29 15:46:02 2021 +0200 +++ b/svghmi/svghmi.py Tue Mar 30 10:05:55 2021 +0200 @@ -31,6 +31,7 @@ MatchTranslations, TranslationToEtree, open_pofile from svghmi.hmi_tree import HMI_TYPES, HMITreeNode, SPECIAL_NODES from svghmi.ui import SVGHMI_UI +from svghmi.fonts import GetFontTypeAndFamilyName, GetCSSFontFaceFromFontFile ScriptDirectory = paths.AbsDir(__file__) @@ -292,27 +293,35 @@ "method": "_ImportSVG" }, { - "bitmap": "EditSVG", # should be something different + "bitmap": "EditSVG", "name": _("Inkscape"), "tooltip": _("Edit HMI"), "method": "_StartInkscape" }, { - "bitmap": "OpenPOT", # should be something different + "bitmap": "OpenPOT", "name": _("New lang"), "tooltip": _("Open non translated message catalog (POT) to start new language"), "method": "_OpenPOT" }, - { - "bitmap": "EditPO", # should be something different + "bitmap": "EditPO", "name": _("Edit lang"), "tooltip": _("Edit existing message catalog (PO) for specific language"), "method": "_EditPO" }, - - # TODO : HMITree button - # - can drag'n'drop variabes to Inkscape + { + "bitmap": "AddFont", + "name": _("Add Font"), + "tooltip": _("Add TTF, OTH or WOFF font to be embedded in HMI"), + "method": "_AddFont" + }, + { + "bitmap": "DelFont", + "name": _("Delete Font"), + "tooltip": _("Remove font previously added to HMI"), + "method": "_DelFont" + }, ] def _getSVGpath(self, project_path=None): @@ -608,6 +617,12 @@ else: self.GetCTRoot().logger.write_error(_("POT file does not exist, add translatable text (label starting with '_') in Inkscape first\n")) + def _AddFont(self): + pass + + def _DelFont(self): + pass + def CTNGlobalInstances(self): # view_name = self.BaseParams.getName() # return [ (view_name + "_" + name, iec_type, "") for name, iec_type in SPECIAL_NODES]