1 /*
2 * Copyright 2011 Google Inc. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #include "sfntly/table/bitmap/ebsc_table.h"
18
19 namespace sfntly {
20 /******************************************************************************
21 * EbscTable class
22 ******************************************************************************/
~EbscTable()23 EbscTable::~EbscTable() {
24 }
25
Version()26 int32_t EbscTable::Version() {
27 return data_->ReadFixed(Offset::kVersion);
28 }
29
NumSizes()30 int32_t EbscTable::NumSizes() {
31 return data_->ReadULongAsInt(Offset::kNumSizes);
32 }
33
EbscTable(Header * header,ReadableFontData * data)34 EbscTable::EbscTable(Header* header, ReadableFontData* data)
35 : Table(header, data) {
36 }
37
38 /******************************************************************************
39 * EbscTable::BitmapScaleTable class
40 ******************************************************************************/
~BitmapScaleTable()41 EbscTable::BitmapScaleTable::~BitmapScaleTable() {
42 }
43
BitmapScaleTable(ReadableFontData * data)44 EbscTable::BitmapScaleTable::BitmapScaleTable(ReadableFontData* data)
45 : SubTable(data) {
46 }
47
PpemX()48 int32_t EbscTable::BitmapScaleTable::PpemX() {
49 return data_->ReadByte(Offset::kBitmapScaleTable_ppemX);
50 }
51
PpemY()52 int32_t EbscTable::BitmapScaleTable::PpemY() {
53 return data_->ReadByte(Offset::kBitmapScaleTable_ppemY);
54 }
55
SubstitutePpemX()56 int32_t EbscTable::BitmapScaleTable::SubstitutePpemX() {
57 return data_->ReadByte(Offset::kBitmapScaleTable_substitutePpemX);
58 }
59
SubstitutePpemY()60 int32_t EbscTable::BitmapScaleTable::SubstitutePpemY() {
61 return data_->ReadByte(Offset::kBitmapScaleTable_substitutePpemY);
62 }
63
64 /******************************************************************************
65 * EbscTable::Builder class
66 ******************************************************************************/
~Builder()67 EbscTable::Builder::~Builder() {
68 }
69
CreateBuilder(Header * header,WritableFontData * data)70 CALLER_ATTACH EbscTable::Builder* EbscTable::Builder::CreateBuilder(
71 Header* header, WritableFontData* data) {
72 EbscTableBuilderPtr builder = new EbscTable::Builder(header, data);
73 return builder.Detach();
74 }
75
Builder(Header * header,WritableFontData * data)76 EbscTable::Builder::Builder(Header* header, WritableFontData* data)
77 : Table::Builder(header, data) {
78 }
79
Builder(Header * header,ReadableFontData * data)80 EbscTable::Builder::Builder(Header* header, ReadableFontData* data)
81 : Table::Builder(header, data) {
82 }
83
84 CALLER_ATTACH
SubBuildTable(ReadableFontData * data)85 FontDataTable* EbscTable::Builder::SubBuildTable(ReadableFontData* data) {
86 EbscTablePtr output = new EbscTable(header(), data);
87 return output.Detach();
88 }
89
SubDataSet()90 void EbscTable::Builder::SubDataSet() {
91 // NOP
92 }
93
SubDataSizeToSerialize()94 int32_t EbscTable::Builder::SubDataSizeToSerialize() {
95 return 0;
96 }
97
SubReadyToSerialize()98 bool EbscTable::Builder::SubReadyToSerialize() {
99 return false;
100 }
101
SubSerialize(WritableFontData * new_data)102 int32_t EbscTable::Builder::SubSerialize(WritableFontData* new_data) {
103 UNREFERENCED_PARAMETER(new_data);
104 return 0;
105 }
106
107 } // namespace sfntly
108