Hot Door CORE Forum

Full Version: getting document character styles
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How does one get the character styles defined in the current document? I want to apply an existing text style, chosen by the user, to new text art.

In the code below, it crashes on the first line with the error "Thread 1: EXC_BAD_ACCESS (code=1, address=0x8)"

I'm guessing here that the showAllStyles method populates the TextCharStyleSet with all current character styles whether used or not.

Code:
#include "hdicoreTextCharStyle.h"
#include "hdicoreTextCharStyleSet.h"
#include "hdicoreTextCharInspector.h"
#include "hdicoreTextCharFeatures.h"
#include "hdicoreTypes.h"

hdi::core::TextCharStyleSet css; // <--- crashes here
css.showAllStyles();

Any help would be much appreciated.