01: /* ====================================================================
02: Licensed to the Apache Software Foundation (ASF) under one or more
03: contributor license agreements. See the NOTICE file distributed with
04: this work for additional information regarding copyright ownership.
05: The ASF licenses this file to You under the Apache License, Version 2.0
06: (the "License"); you may not use this file except in compliance with
07: the License. You may obtain a copy of the License at
08:
09: http://www.apache.org/licenses/LICENSE-2.0
10:
11: Unless required by applicable law or agreed to in writing, software
12: distributed under the License is distributed on an "AS IS" BASIS,
13: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: See the License for the specific language governing permissions and
15: limitations under the License.
16: ==================================================================== */
17:
18: package org.apache.poi.hwpf.usermodel;
19:
20: import org.apache.poi.util.BitField;
21: import org.apache.poi.util.BitFieldFactory;
22: import org.apache.poi.util.LittleEndian;
23:
24: /**
25: * This data structure is used by a paragraph to determine how it should drop
26: * its first letter. I think its the visual effect that will show a giant first
27: * letter to a paragraph. I've seen this used in the first paragraph of a
28: * book
29: *
30: * @author Ryan Ackley
31: */
32: public class DropCapSpecifier {
33: private short _info;
34: private static BitField _type = BitFieldFactory.getInstance(0x07);
35: private static BitField _lines = BitFieldFactory.getInstance(0xf8);
36:
37: public DropCapSpecifier(byte[] buf, int offset) {
38: this (LittleEndian.getShort(buf, offset));
39: }
40:
41: public DropCapSpecifier(short info) {
42: _info = info;
43: }
44:
45: public short toShort() {
46: return _info;
47: }
48: }
|