Try to set FontCharset.MAC value to font via setCharSet(int) method. Actual: POIXMLException exception
Is that one of the allowed values in .xlsx?
Probably but i'm not sure. For my locale font.getCharSet() returns FontCharset.RUSSIAN.
Any chance you could dig into the Microsoft specs, and check what they say?
I found in the specification (Excel 2007 Binary File Format specification) font character set. 0= Ansi 1= Default 2= Symbol 77= Mac 128= Japanese 129= Korean 130= Johab 134= GB2312 136= Chinese Big 5 161= Greek 162= Turkish 163= Vietnamese 177= Hebrew 178= Arabic 186= Baltic 204= Russian 222= Thai 238= East Europe 255= Oem Ie the same as FontCharset has.
Patch: public void setCharSet(int charset) { CTIntProperty charsetProperty = _ctFont.sizeOfCharsetArray() == 0 ? _ctFont.addNewCharset() : _ctFont.getCharsetArray(0); FontCharset fontCharset = FontCharset.valueOf(charset); if (fontCharset != null) { charsetProperty.setVal(fontCharset.getValue()); } else { throw new POIXMLException("Attention: an attempt to set a type of unknow charset and charset"); } }
Thanks for the patch. As we already had a setter which took a FontCharset object, I flipped it around a little bit, so we didn't need to do charset -> int -> charset. Fix and unit test committed in 1077950.