Skip to content

Commit

Permalink
cpplint adjustments, add documentation to BASE entry
Browse files Browse the repository at this point in the history
  • Loading branch information
skef committed Jun 19, 2024
1 parent 5a1f356 commit 5a09ab1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion c/addfeatures/hotconv/BASE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <stdlib.h>
#include <stdio.h>

#include <algorithm>

void BASENew(hotCtx g) {
g->ctx.BASEp = new BASE(g);
}
Expand Down Expand Up @@ -69,7 +71,6 @@ Offset BASE::fillSharedData() {
bvSize += bv.size();

baseValues.emplace_back(std::move(bv));

}

/* Adjust BaseValue coord offsets */
Expand Down
8 changes: 6 additions & 2 deletions c/addfeatures/hotconv/BASE.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#ifndef ADDFEATURES_HOTCONV_BASE_H_
#define ADDFEATURES_HOTCONV_BASE_H_

#include <utility>
#include <vector>

#include "common.h"

#define BASE_ TAG('B', 'A', 'S', 'E')
Expand All @@ -26,7 +29,7 @@ class BASE {
}
Tag baseScriptTag {0};
int16_t baseScriptInx {0};
int32_t baseScriptOffset {0} ; // |-> BaseScriptList
int32_t baseScriptOffset {0}; // |-> BaseScriptList
// long instead of Offset for temp -ve value
};

Expand All @@ -41,7 +44,7 @@ class BASE {
void prep(hotCtx g);
Offset fill(Offset curr);
void write(Offset shared, BASE *h);

std::vector<Tag> baseTagList;
Offset baseTagOffset {0};
std::vector<BaseScriptRecord> baseScriptList;
Expand Down Expand Up @@ -110,6 +113,7 @@ class BASE {
int Fill();
void Write();
void setAxisCount(uint16_t axisCount) { ivs.setAxisCount(axisCount); }

private:
int addBaseScript(int dfltInx, size_t nBaseTags, std::vector<VarValueRecord> &coords);
static Offset hdr_size(bool seenVariable) {
Expand Down
5 changes: 4 additions & 1 deletion docs/OpenTypeFeatureFileSpecification.md
Original file line number Diff line number Diff line change
Expand Up @@ -3322,7 +3322,7 @@ A `<script record>` is of the form:

```fea
# Format A
<number>
<(v)number>
# Format B
<number> <glyph> <number>
Expand All @@ -3331,6 +3331,9 @@ A `<script record>` is of the form:
<number> <device>
```

For a variable font, the number in format A can either be plain or be a
variable value specified according to value record format B.

The baseline tags for each `BaseTagList` must be sorted in increasing ASCII
order.

Expand Down

0 comments on commit 5a09ab1

Please sign in to comment.