/** * Create child element {@odf.element svg:font-face-src}. * * @return the element {@odf.element svg:font-face-src} */ public SvgFontFaceSrcElement newSvgFontFaceSrcElement() { SvgFontFaceSrcElement svgFontFaceSrc = ((OdfFileDom) this.ownerDocument).newOdfElement(SvgFontFaceSrcElement.class); this.appendChild(svgFontFaceSrc); return svgFontFaceSrc; }
/** * Receives the value of the ODFDOM attribute representation <code>SvgCapHeightAttribute</code> , See {@odf.attribute svg:cap-height} * * @return - the <code>Integer</code> , the value or <code>null</code>, if the attribute is not set and no default value defined. */ public Integer getSvgCapHeightAttribute() { SvgCapHeightAttribute attr = (SvgCapHeightAttribute) getOdfAttribute(OdfDocumentNamespace.SVG, "cap-height"); if (attr != null) { return Integer.valueOf(attr.intValue()); } return null; }
/** * Sets the value of ODFDOM attribute representation <code>SvgAscentAttribute</code> , See {@odf.attribute svg:ascent} * * @param svgAscentValue The type is <code>Integer</code> */ public void setSvgAscentAttribute(Integer svgAscentValue) { SvgAscentAttribute attr = new SvgAscentAttribute((OdfFileDom) this.ownerDocument); setOdfAttribute(attr); attr.setIntValue(svgAscentValue.intValue()); }
for (int i = 0; i < list.getLength(); i++) { StyleFontFaceElement node = (StyleFontFaceElement) list.item(i); String familyname = node.getSvgFontFamilyAttribute(); String fontName = node.getStyleNameAttribute(); if (aFamilyName.equals(familyname)) { return fontName; for (int i = 0; i < list.getLength(); i++) { StyleFontFaceElement node = (StyleFontFaceElement) list.item(i); String fontName = node.getStyleNameAttribute(); if (aFontName.equals(fontName)) { duplicated = true; newfont.setSvgFontFamilyAttribute(aFamilyName); return aFontName; } catch (Exception e) {
private String getFontFamilyNameFromFontName(String aFontName) { try { // try if the font has been defined. Document mDocument = ((Document) ((OdfFileDom) mElement.getOwnerDocument()).getDocument()); // find <office:font-face-decls> in content dom OdfContentDom contentDom = mDocument.getContentDom(); OfficeFontFaceDeclsElement fontfaceDecls = OdfElement.findFirstChildNode(OfficeFontFaceDeclsElement.class, contentDom.getRootElement()); if (fontfaceDecls == null) { // find <office:font-face-decls> in style dom OdfStylesDom styleDom = mDocument.getStylesDom(); fontfaceDecls = OdfElement.findFirstChildNode(OfficeFontFaceDeclsElement.class, styleDom.getRootElement()); } if (fontfaceDecls == null) { return null; } NodeList list = fontfaceDecls.getElementsByTagName("style:font-face"); for (int i = 0; i < list.getLength(); i++) { StyleFontFaceElement node = (StyleFontFaceElement) list.item(i); String familyname = node.getSvgFontFamilyAttribute(); String fontName = node.getStyleNameAttribute(); if (aFontName.equals(fontName)) { return familyname; } } } catch (Exception e) { Logger.getLogger(TextProperties.class.getName()).log(Level.SEVERE, e.getMessage(), e); } return null; }
/** * Create child element {@odf.element style:font-face}. * * @param styleNameValue the <code>String</code> value of <code>StyleNameAttribute</code>, see {@odf.attribute style:name} at specification * @return the element {@odf.element style:font-face} */ public StyleFontFaceElement newStyleFontFaceElement(String styleNameValue) { StyleFontFaceElement styleFontFace = ((OdfFileDom) this.ownerDocument).newOdfElement(StyleFontFaceElement.class); styleFontFace.setStyleNameAttribute(styleNameValue); this.appendChild(styleFontFace); return styleFontFace; }
/** * Sets the value of ODFDOM attribute representation <code>SvgDescentAttribute</code> , See {@odf.attribute svg:descent} * * @param svgDescentValue The type is <code>Integer</code> */ public void setSvgDescentAttribute(Integer svgDescentValue) { SvgDescentAttribute attr = new SvgDescentAttribute((OdfFileDom) this.ownerDocument); setOdfAttribute(attr); attr.setIntValue(svgDescentValue.intValue()); }
for (int i = 0; i < list.getLength(); i++) { StyleFontFaceElement node = (StyleFontFaceElement) list.item(i); String familyname = node.getSvgFontFamilyAttribute(); String fontName = node.getStyleNameAttribute(); if (aFamilyName.equals(familyname)) { return fontName; for (int i = 0; i < list.getLength(); i++) { StyleFontFaceElement node = (StyleFontFaceElement) list.item(i); String fontName = node.getStyleNameAttribute(); if (aFontName.equals(fontName)) { duplicated = true; newfont.setSvgFontFamilyAttribute(aFamilyName); return aFontName; } catch (Exception e) {
private String getFontFamilyNameFromFontName(String aFontName) { try { // try if the font has been defined. Document mDocument = ((Document) ((OdfFileDom) mElement.getOwnerDocument()).getDocument()); // find <office:font-face-decls> in content dom OdfContentDom contentDom = mDocument.getContentDom(); OfficeFontFaceDeclsElement fontfaceDecls = OdfElement.findFirstChildNode(OfficeFontFaceDeclsElement.class, contentDom.getRootElement()); if (fontfaceDecls == null) { // find <office:font-face-decls> in style dom OdfStylesDom styleDom = mDocument.getStylesDom(); fontfaceDecls = OdfElement.findFirstChildNode(OfficeFontFaceDeclsElement.class, styleDom.getRootElement()); } if (fontfaceDecls == null) { return null; } NodeList list = fontfaceDecls.getElementsByTagName("style:font-face"); for (int i = 0; i < list.getLength(); i++) { StyleFontFaceElement node = (StyleFontFaceElement) list.item(i); String familyname = node.getSvgFontFamilyAttribute(); String fontName = node.getStyleNameAttribute(); if (aFontName.equals(fontName)) { return familyname; } } } catch (Exception e) { Logger.getLogger(TextProperties.class.getName()).log(Level.SEVERE, e.getMessage(), e); } return null; }
/** * Create child element {@odf.element style:font-face}. * * @param styleNameValue the <code>String</code> value of <code>StyleNameAttribute</code>, see {@odf.attribute style:name} at specification * @return the element {@odf.element style:font-face} */ public StyleFontFaceElement newStyleFontFaceElement(String styleNameValue) { StyleFontFaceElement styleFontFace = ((OdfFileDom) this.ownerDocument).newOdfElement(StyleFontFaceElement.class); styleFontFace.setStyleNameAttribute(styleNameValue); this.appendChild(styleFontFace); return styleFontFace; }
/** * Receives the value of the ODFDOM attribute representation <code>SvgFontFamilyAttribute</code> , See {@odf.attribute svg:font-family} * * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set and no default value defined. */ public String getSvgFontFamilyAttribute() { SvgFontFamilyAttribute attr = (SvgFontFamilyAttribute) getOdfAttribute(OdfDocumentNamespace.SVG, "font-family"); if (attr != null) { return String.valueOf(attr.getValue()); } return null; }
/** * Sets the value of ODFDOM attribute representation <code>SvgHangingAttribute</code> , See {@odf.attribute svg:hanging} * * @param svgHangingValue The type is <code>Integer</code> */ public void setSvgHangingAttribute(Integer svgHangingValue) { SvgHangingAttribute attr = new SvgHangingAttribute((OdfFileDom) this.ownerDocument); setOdfAttribute(attr); attr.setIntValue(svgHangingValue.intValue()); }
for (int i = 0; i < list.getLength(); i++) { StyleFontFaceElement node = (StyleFontFaceElement) list.item(i); String familyname = node.getSvgFontFamilyAttribute(); String fontName = node.getStyleNameAttribute(); if (aFamilyName.equals(familyname)) { return fontName; for (int i = 0; i < list.getLength(); i++) { StyleFontFaceElement node = (StyleFontFaceElement) list.item(i); String fontName = node.getStyleNameAttribute(); if (aFontName.equals(fontName)) { duplicated = true; newfont.setSvgFontFamilyAttribute(aFamilyName); return aFontName; } catch (Exception e) {
private String getFontFamilyNameFromFontName(String aFontName) { try { // try if the font has been defined. Document mDocument = ((Document) ((OdfFileDom) mElement.getOwnerDocument()).getDocument()); // find <office:font-face-decls> in content dom OdfContentDom contentDom = mDocument.getContentDom(); OfficeFontFaceDeclsElement fontfaceDecls = OdfElement.findFirstChildNode(OfficeFontFaceDeclsElement.class, contentDom.getRootElement()); if (fontfaceDecls == null) { // find <office:font-face-decls> in style dom OdfStylesDom styleDom = mDocument.getStylesDom(); fontfaceDecls = OdfElement.findFirstChildNode(OfficeFontFaceDeclsElement.class, styleDom .getRootElement()); } if (fontfaceDecls == null) return null; NodeList list = fontfaceDecls.getElementsByTagName("style:font-face"); for (int i = 0; i < list.getLength(); i++) { StyleFontFaceElement node = (StyleFontFaceElement) list.item(i); String familyname = node.getSvgFontFamilyAttribute(); String fontName = node.getStyleNameAttribute(); if (aFontName.equals(fontName)) { return familyname; } } } catch (Exception e) { e.printStackTrace(); } return null; }
/** * Create child element {@odf.element svg:font-face-src}. * * @return the element {@odf.element svg:font-face-src} */ public SvgFontFaceSrcElement newSvgFontFaceSrcElement() { SvgFontFaceSrcElement svgFontFaceSrc = ((OdfFileDom) this.ownerDocument).newOdfElement(SvgFontFaceSrcElement.class); this.appendChild(svgFontFaceSrc); return svgFontFaceSrc; }
/** * Create child element {@odf.element style:font-face}. * * @param styleNameValue the <code>String</code> value of <code>StyleNameAttribute</code>, see {@odf.attribute style:name} at specification * @return the element {@odf.element style:font-face} */ public StyleFontFaceElement newStyleFontFaceElement(String styleNameValue) { StyleFontFaceElement styleFontFace = ((OdfFileDom) this.ownerDocument).newOdfElement(StyleFontFaceElement.class); styleFontFace.setStyleNameAttribute(styleNameValue); this.appendChild(styleFontFace); return styleFontFace; }
/** * Receives the value of the ODFDOM attribute representation <code>SvgIdeographicAttribute</code> , See {@odf.attribute svg:ideographic} * * @return - the <code>Integer</code> , the value or <code>null</code>, if the attribute is not set and no default value defined. */ public Integer getSvgIdeographicAttribute() { SvgIdeographicAttribute attr = (SvgIdeographicAttribute) getOdfAttribute(OdfDocumentNamespace.SVG, "ideographic"); if (attr != null) { return Integer.valueOf(attr.intValue()); } return null; }
/** * Sets the value of ODFDOM attribute representation <code>SvgUnderlineThicknessAttribute</code> , See {@odf.attribute svg:underline-thickness} * * @param svgUnderlineThicknessValue The type is <code>Integer</code> */ public void setSvgUnderlineThicknessAttribute(Integer svgUnderlineThicknessValue) { SvgUnderlineThicknessAttribute attr = new SvgUnderlineThicknessAttribute((OdfFileDom) this.ownerDocument); setOdfAttribute(attr); attr.setIntValue(svgUnderlineThicknessValue.intValue()); }
/** * Create child element {@odf.element svg:font-face-src}. * * @return the element {@odf.element svg:font-face-src} */ public SvgFontFaceSrcElement newSvgFontFaceSrcElement() { SvgFontFaceSrcElement svgFontFaceSrc = ((OdfFileDom) this.ownerDocument).newOdfElement(SvgFontFaceSrcElement.class); this.appendChild(svgFontFaceSrc); return svgFontFaceSrc; }
/** * Receives the value of the ODFDOM attribute representation <code>SvgUnderlinePositionAttribute</code> , See {@odf.attribute svg:underline-position} * * @return - the <code>Integer</code> , the value or <code>null</code>, if the attribute is not set and no default value defined. */ public Integer getSvgUnderlinePositionAttribute() { SvgUnderlinePositionAttribute attr = (SvgUnderlinePositionAttribute) getOdfAttribute(OdfDocumentNamespace.SVG, "underline-position"); if (attr != null) { return Integer.valueOf(attr.intValue()); } return null; }