public Part CreateThemePartObject(String partName) throws InvalidFormatException { return new ThemePart(new PartName(partName)); }
private FontCollection getMajorFontCollection() throws Docx4JException { if (majorFontCollectionInitialised) return majorFontCollection; if (this.getContents().getThemeElements()!=null && this.getContents().getThemeElements().getFontScheme()!=null) { majorFontCollection = this.getContents().getThemeElements().getFontScheme().getMajorFont(); } majorFontCollectionInitialised = true; return majorFontCollection; }
String font=null; try { font = getThemePart().getFont(rFonts.getAsciiTheme(), themeFontLang); } catch (Docx4JException e) {
return getFontFromTheme(type); log.debug(type.toString() ); String lang = this.getLang(themeFontLang, type); if (lang==null) { log.debug("lang==null"); return getFontFromTheme(type); return getFontFromTheme(type); } else { if (isMajor(type)) { typeface = getScriptToTypefaceMajor().get(script); } else { typeface = getScriptToTypefaceMinor().get(script); return getFontFromTheme(type); } else { return typeface;
private TextFont getTextFontFromTheme(STTheme type) throws Docx4JException { if (type.equals(STTheme.MAJOR_EAST_ASIA)) { return getMajorEastAsian(); } else if (type.equals(STTheme.MINOR_EAST_ASIA)) { return getMinorEastAsian(); } else if (type.equals(STTheme.MAJOR_ASCII)) { return getMajorLatin(); } else if (type.equals(STTheme.MINOR_ASCII)) { return getMinorLatin(); } else if (type.equals(STTheme.MAJOR_BIDI)) { return getMajorComplexScript(); } else if (type.equals(STTheme.MINOR_BIDI)) { return getMinorComplexScript(); } else if (type.equals(STTheme.MAJOR_H_ANSI)) { return getMajorHighAnsi(); } else if (type.equals(STTheme.MINOR_H_ANSI)) { return getMinorHighAnsi(); } return getMinorLatin(); }
themePart.unmarshal( FileUtils.openInputStream(new File(System.getProperty("user.dir") + "/theme2.xml")) );
public org.docx4j.dml.BaseStyles.FontScheme getFontScheme() { if (fontScheme == null) { // ie we haven't done this already org.docx4j.dml.Theme theme = (org.docx4j.dml.Theme) this .getJaxbElement(); if (theme.getThemeElements() != null && theme.getThemeElements().getFontScheme() != null) { fontScheme = theme.getThemeElements().getFontScheme(); } } return fontScheme; }
public static List<Style> generateStyles(PresentationMLPackage presentationMLPackage) throws InvalidFormatException { ThemePart tp = (ThemePart)presentationMLPackage.getParts().getParts().get( new PartName("/ppt/theme/theme1.xml")); FontScheme fontScheme = tp.getFontScheme(); List<Style> styles = new ArrayList<Style>(); TextStyles.generateDocDefaults(fontScheme); // presentation.xml MainPresentationPart pp = (MainPresentationPart)presentationMLPackage.getParts().getParts().get( new PartName("/ppt/presentation.xml")); styles.addAll( TextStyles.generateWordStylesFromPresentationPart( pp.getJaxbElement().getDefaultTextStyle(), "", fontScheme)); // master SlideMasterPart master = (SlideMasterPart)presentationMLPackage.getParts().getParts().get( new PartName("/ppt/slideMasters/slideMaster1.xml")); styles.addAll( TextStyles.generateWordStylesForMaster( master.getJaxbElement().getTxStyles(), 1, fontScheme)); return styles; }
private TextFont getTextFontFromTheme(STTheme type) throws Docx4JException { if (type.equals(STTheme.MAJOR_EAST_ASIA)) { return getMajorEastAsian(); } else if (type.equals(STTheme.MINOR_EAST_ASIA)) { return getMinorEastAsian(); } else if (type.equals(STTheme.MAJOR_ASCII)) { return getMajorLatin(); } else if (type.equals(STTheme.MINOR_ASCII)) { return getMinorLatin(); } else if (type.equals(STTheme.MAJOR_BIDI)) { return getMajorComplexScript(); } else if (type.equals(STTheme.MINOR_BIDI)) { return getMinorComplexScript(); } else if (type.equals(STTheme.MAJOR_H_ANSI)) { return getMajorHighAnsi(); } else if (type.equals(STTheme.MINOR_H_ANSI)) { return getMinorHighAnsi(); } return getMinorLatin(); }
return getFontFromTheme(type); log.debug(type.toString() ); String lang = this.getLang(themeFontLang, type); if (lang==null) { log.debug("lang==null"); return getFontFromTheme(type); return getFontFromTheme(type); } else { if (isMajor(type)) { typeface = getScriptToTypefaceMajor().get(script); } else { typeface = getScriptToTypefaceMinor().get(script); return getFontFromTheme(type); } else { return typeface;
public org.docx4j.dml.BaseStyles.FontScheme getFontScheme() { if (fontScheme == null) { // ie we haven't done this already org.docx4j.dml.Theme theme = (org.docx4j.dml.Theme) this .getJaxbElement(); if (theme.getThemeElements() != null && theme.getThemeElements().getFontScheme() != null) { fontScheme = theme.getThemeElements().getFontScheme(); } } return fontScheme; }
public static List<Style> generateStyles(PresentationMLPackage presentationMLPackage) throws InvalidFormatException { ThemePart tp = (ThemePart)presentationMLPackage.getParts().getParts().get( new PartName("/ppt/theme/theme1.xml")); FontScheme fontScheme = tp.getFontScheme(); List<Style> styles = new ArrayList<Style>(); TextStyles.generateDocDefaults(fontScheme); // presentation.xml MainPresentationPart pp = (MainPresentationPart)presentationMLPackage.getParts().getParts().get( new PartName("/ppt/presentation.xml")); styles.addAll( TextStyles.generateWordStylesFromPresentationPart( pp.getJaxbElement().getDefaultTextStyle(), "", fontScheme)); // master SlideMasterPart master = (SlideMasterPart)presentationMLPackage.getParts().getParts().get( new PartName("/ppt/slideMasters/slideMaster1.xml")); styles.addAll( TextStyles.generateWordStylesForMaster( master.getJaxbElement().getTxStyles(), 1, fontScheme)); return styles; }
private FontCollection getMinorFontCollection() throws Docx4JException { if (minorFontCollectionInitialised) return minorFontCollection; if (this.getContents().getThemeElements()!=null && this.getContents().getThemeElements().getFontScheme()!=null) { minorFontCollection = this.getContents().getThemeElements().getFontScheme().getMinorFont(); } minorFontCollectionInitialised = true; return minorFontCollection; }
fontName = getThemePart().getFont(rFonts.getCstheme(), themeFontLang); } catch (Docx4JException e) { && getThemePart()!=null) { try { eastAsia = getThemePart().getFont(rFonts.getEastAsiaTheme(), themeFontLang); } catch (Docx4JException e) { && getThemePart()!=null) { try { ascii = getThemePart().getFont(rFonts.getAsciiTheme(), themeFontLang); } catch (Docx4JException e) { && getThemePart()!=null) { try { hAnsi = getThemePart().getFont(rFonts.getHAnsiTheme(), themeFontLang); } catch (Docx4JException e) {
public Part CreateThemePartObject(String partName) throws InvalidFormatException { return new ThemePart(new PartName(partName)); }
private FontCollection getMinorFontCollection() throws Docx4JException { if (minorFontCollectionInitialised) return minorFontCollection; if (this.getContents().getThemeElements()!=null && this.getContents().getThemeElements().getFontScheme()!=null) { minorFontCollection = this.getContents().getThemeElements().getFontScheme().getMinorFont(); } minorFontCollectionInitialised = true; return minorFontCollection; }
String font=null; try { font = getThemePart().getFont(rFonts.getAsciiTheme(), themeFontLang); } catch (Docx4JException e) {
private FontCollection getMajorFontCollection() throws Docx4JException { if (majorFontCollectionInitialised) return majorFontCollection; if (this.getContents().getThemeElements()!=null && this.getContents().getThemeElements().getFontScheme()!=null) { majorFontCollection = this.getContents().getThemeElements().getFontScheme().getMajorFont(); } majorFontCollectionInitialised = true; return majorFontCollection; }