sbmlteam / jsbml

JSBML is a community-driven project to create a free, open-source, pure Java™ library for reading, writing, and manipulating SBML files (the Systems Biology Markup Language) and data streams. It is an alternative to the mixed Java/native code-based interface provided in libSBML.
https://sbml.org/software/jsbml/
GNU Lesser General Public License v2.1
37 stars 24 forks source link

Render font family #194

Closed Onur101010 closed 4 years ago

Onur101010 commented 4 years ago

Changed FontFamilyenum to support the Strings "monospace", "sans-serif" and "serif" instead of the uppercase names of the enum values. Also changing FontFamily values to String is easier now because of the extra stored value (String), simply using toString() is enough.

In addition to that a new method toFontFamily() matches Strings and gives the value back as FontFamily if it is contained in the enum.

The standard storing value is String, therefore all classes using FontFamily as standard were updated too.

niko-rodrigue commented 4 years ago

The changes look fine. One thing that you should check is that you write the proper string to XML, like defined in the specifications and that you can read it again from the file. You could add another test that read from a file and write it to a String and you can read the SBMLDocument again from this String to check that the font family is still there.

Onur101010 commented 4 years ago

I added a testclass with a dummy document with the font-family attribute set. The second test writeAndReadTest() first writes the document to a String and then reads it back and afterwards tests if the font-family attribute is set correctly.