Пример #1
0
        public Font(IStreamReader reader, RecordType id, UInt16 length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            // initialize class members from stream
            this.dyHeight = reader.ReadUInt16();

            UInt16 flags = reader.ReadUInt16();

            // 0x0001 is unused
            this.fItalic = Utils.BitmaskToBool(flags, 0x0002);
            // 0x0004 is unused
            this.fStrikeOut = Utils.BitmaskToBool(flags, 0x0008);
            this.fOutline   = Utils.BitmaskToBool(flags, 0x0010);
            this.fShadow    = Utils.BitmaskToBool(flags, 0x0020);
            this.fCondense  = Utils.BitmaskToBool(flags, 0x0040);
            this.fExtend    = Utils.BitmaskToBool(flags, 0x0080);

            this.icv      = reader.ReadUInt16();
            this.bls      = (FontWeight)reader.ReadUInt16();
            this.sss      = (ScriptStyle)reader.ReadUInt16();
            this.uls      = (UnderlineStyle)reader.ReadByte();
            this.bFamily  = (FontFamily)reader.ReadByte();
            this.bCharSet = reader.ReadByte();

            // skip unused byte
            reader.ReadByte();

            this.fontName = new ShortXLUnicodeString(reader);

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }
Пример #2
0
 /**
  * Creates a font of the specified face, point size, bold style,
  * italicisation, underline style, colour, and script
  * style (superscript/subscript)
  *
  * @param ps the point size
  * @param bs the bold style
  * @param us the underline style
  * @param fn the font name
  * @param it the italic flag
  * @param c the colour
  * @param ss the script style
  * @deprecated use jxl.write.WritableFont
  */
 public Font(FontName fn,
             int ps,
             BoldStyle bs,
             bool it,
             UnderlineStyle us,
             Colour c,
             ScriptStyle ss)
     : base(fn, ps, bs, it, us, c, ss)
 {
 }
Пример #3
0
 /**
  * Creates a font of the specified face, point size, bold style,
  * italicisation, underline style, colour, and script
  * style (superscript/subscript)
  *
  * @param ps the point size
  * @param bs the bold style
  * @param us the underline style
  * @param fn the font name
  * @param it the italic flag
  * @param c the colour
  * @param ss the script style
  */
 public WritableFont(FontName fn,
                     int ps,
                     BoldStyle bs,
                     bool it,
                     UnderlineStyle us,
                     Colour c,
                     ScriptStyle ss)
     : base(fn.name, ps, bs.value, it, us.getValue(), c.getValue(), ss.getValue())
 {
 }
Пример #4
0
        public static ST_VerticalAlignRun ToInternalScriptStyle(ScriptStyle scriptStyle)
        {
            switch (scriptStyle)
            {
            case ScriptStyle.Superscript:
                return(ST_VerticalAlignRun.superscript);

            case ScriptStyle.Subscript:
                return(ST_VerticalAlignRun.subscript);

            default:
                return(ST_VerticalAlignRun.baseline);
            }
        }
Пример #5
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                DataColumnScript s = null != o ? (DataColumnScript)o : new DataColumnScript();


                ScriptStyle scriptStyle  = (ScriptStyle)info.GetInt32("Style");
                string      scriptText   = info.GetString("Text");
                string      rowFrom      = info.GetString("From");
                string      rowCondition = info.GetString("Cond");
                string      rowTo        = info.GetString("To");
                string      rowInc       = info.GetString("Inc");

                s.ScriptText = scriptText;

                return(s);
            }
Пример #6
0
 /**
  * Gets the script style
  *
  * @return the script style
  */
 public ScriptStyle getScriptStyle()
 {
     return(ScriptStyle.getStyle(scriptStyle));
 }
Пример #7
0
 /**
  * Sets the script style (eg. superscript, subscript) for this font,
  * if the font hasn't been initialized
  *
  * @param scriptStyle the colour
  * @exception WriteException, if this font is already in use elsewhere
  */
 public void setScriptStyle(ScriptStyle scriptStyle)
 {
     base.setScriptStyle(scriptStyle.getValue());
 }