Skip to content

Commit

Permalink
added info logging when setting platform of fonttable to Windows when…
Browse files Browse the repository at this point in the history
… running on linux
  • Loading branch information
kienerj committed Nov 2, 2023
1 parent b09630b commit 6064190
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pycdxml/cdxml_converter/chemdraw_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def from_bytes(property_bytes: bytes, charset='iso-8859-1', fonttable=None) -> '
# In that case get_charset will be off by 2 bytes and determine a font id which does not exist in the
# document. hence we catch that here and re-read bytes assuming no style runs at all + ascii charset
# I have only observed this in newer files from ChemDraw 21.
# Potential issue: if the byte offset happens to by accident lead to a valid font, the problem will
# Potential issue: if the byte offset happens to lead by accident to a valid font, the problem will
# emerge somewhere else (possibly only after visual inspection of the file). this is however unlikley to happen
# as font_ids usually are around 1-10 which happen to be ASCII control characters unlikely to be at the
# start of a string
Expand Down Expand Up @@ -367,6 +367,7 @@ def from_element(fonttable: ET.Element) -> 'CDXFontTable':
os_type = CDXFontTable.PLATFORM_MAC
else:
# running on linux / not supported -> set to windows
logger.info("Detected Linux OS. Setting cdx file platform type to default of 'Windows'.")
os_type = CDXFontTable.PLATFORM_WINDOWS
return CDXFontTable(os_type, fonts)

Expand Down

0 comments on commit 6064190

Please sign in to comment.