- I tried some fonts exported on windows using the FontSerializer GUI, it works on windows
- I moved the code to MAC, and i get a crash like that:
#0 0xffff088c in __memcpy
#1 0x003dae6c in juce::MemoryInputStream::read at juce_MemoryInputStream.cpp:74
#2 0x003da14f in juce::GZIPDecompressorInputStream::read at juce_GZIPDecompressorInputStream.cpp:224
#3 0x003f6663 in juce::BufferedInputStream::ensureBuffered at juce_BufferedInputStream.cpp:127
#4 0x003f682a in juce::BufferedInputStream::read at juce_BufferedInputStream.cpp:149
#5 0x003a5daf in juce::InputStream::readByte at juce_InputStream.cpp:38
#6 0x0041baf3 in juce::InputStream::readString at juce_InputStream.cpp:165
#7 0x0041bc9a in juce::BufferedInputStream::readString at juce_BufferedInputStream.cpp:199
#8 0x004839e1 in juce::CustomTypeface::CustomTypeface at juce_Typeface.cpp:150
#9 0x00286e04 in getBuiltInFont at CtrlrUtilities.cpp:496
i built the FontSerializer on the mac, and whenever i want to export a font i get a crash, this time
#1 0x003abbc5 in juce::MacTypeface::getOutlineForGlyph at juce_mac_Fonts.mm:221
#2 0x000eba11 in juce::CustomTypeface::addGlyphsFromOtherTypeface at juce_Typeface.cpp:296
#3 0x0000c2ff in MainComponent::exportFonts at MainComponent.cpp:175
#4 0x0000ca9d in MainComponent::buttonClicked at MainComponent.cpp:130
#5 0x002c2d22 in juce::ListenerList<juce::Button::Listener, juce::Array<juce::Button::Listener*, juce::DummyCriticalSection> >::callChecked<juce::Component::BailOutChecker, juce::Button*> at juce_ListenerList.h:181
#6 0x002166b0 in juce::Button::sendClickMessage at juce_Button.cpp:384
the code that does that
String fontName=cbFonts->getText();//T("Arial.ttf");
Font font(fontName , 16.0f, Font::plain);
// copy the font-properties to a CustomTypeface
CustomTypeface customTypeface;
customTypeface.setCharacteristics(fontName, font.getAscent(),font.isBold(), font.isItalic(), ' ');
// Here's the important part: copy all glyphs to a new instance of CustomTypeface
if (font.getTypeface())
{
customTypeface.addGlyphsFromOtherTypeface( *font.getTypeface(), 0, 256);
}
else
{
Logger::writeToLog ("Can't fetch typeface");
}
MemoryOutputStream str;
customTypeface.writeToStream(str);
uint8 *p=(uint8*)str.getData();
is this a bug in my code, or did something change in the MAC/Font handling routines and we should update our code.