summaryrefslogtreecommitdiff
path: root/fofi
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2018-09-23 00:43:11 +0200
committerAlbert Astals Cid <aacid@kde.org>2018-09-23 00:43:11 +0200
commita28116539832cde87acd844aa0130df0eed405d6 (patch)
tree4facebb281b01c2a25a44241ec84cbfcfb97063b /fofi
parentda87b12ef125e3c2d43822004f1f9f2a7f45aaf3 (diff)
FoFiType1C: Add some const
Diffstat (limited to 'fofi')
-rw-r--r--fofi/FoFiType1C.cc18
-rw-r--r--fofi/FoFiType1C.h18
2 files changed, 18 insertions, 18 deletions
diff --git a/fofi/FoFiType1C.cc b/fofi/FoFiType1C.cc
index 6e42bb25..db7b98c6 100644
--- a/fofi/FoFiType1C.cc
+++ b/fofi/FoFiType1C.cc
@@ -113,15 +113,15 @@ FoFiType1C::~FoFiType1C() {
}
}
-char *FoFiType1C::getName() {
+const char *FoFiType1C::getName() const {
return name ? name->getCString() : (char *)nullptr;
}
-char **FoFiType1C::getEncoding() {
+char **FoFiType1C::getEncoding() const {
return encoding;
}
-GooString *FoFiType1C::getGlyphName(int gid) {
+GooString *FoFiType1C::getGlyphName(int gid) const {
char buf[256];
GBool ok;
@@ -135,7 +135,7 @@ GooString *FoFiType1C::getGlyphName(int gid) {
return new GooString(buf);
}
-int *FoFiType1C::getCIDToGIDMap(int *nCIDs) {
+int *FoFiType1C::getCIDToGIDMap(int *nCIDs) const {
int *map;
int n, i;
@@ -163,7 +163,7 @@ int *FoFiType1C::getCIDToGIDMap(int *nCIDs) {
return map;
}
-void FoFiType1C::getFontMatrix(double *mat) {
+void FoFiType1C::getFontMatrix(double *mat) const {
int i;
if (topDict.firstOp == 0x0c1e && privateDicts[0].hasFontMatrix) {
@@ -192,7 +192,7 @@ void FoFiType1C::getFontMatrix(double *mat) {
}
}
-void FoFiType1C::convertToType1(char *psName, const char **newEncoding, GBool ascii,
+void FoFiType1C::convertToType1(const char *psName, const char **newEncoding, GBool ascii,
FoFiOutputFunc outputFunc,
void *outputStream) {
int psNameLen;
@@ -2726,8 +2726,8 @@ void FoFiType1C::getIndex(int pos, Type1CIndex *idx, GBool *ok) {
}
}
-void FoFiType1C::getIndexVal(Type1CIndex *idx, int i,
- Type1CIndexVal *val, GBool *ok) {
+void FoFiType1C::getIndexVal(const Type1CIndex *idx, int i,
+ Type1CIndexVal *val, GBool *ok) const {
int pos0, pos1;
if (i < 0 || i >= idx->len) {
@@ -2747,7 +2747,7 @@ void FoFiType1C::getIndexVal(Type1CIndex *idx, int i,
val->len = pos1 - pos0;
}
-char *FoFiType1C::getString(int sid, char *buf, GBool *ok) {
+char *FoFiType1C::getString(int sid, char *buf, GBool *ok) const {
Type1CIndexVal val;
int n;
diff --git a/fofi/FoFiType1C.h b/fofi/FoFiType1C.h
index 03a16004..541c193d 100644
--- a/fofi/FoFiType1C.h
+++ b/fofi/FoFiType1C.h
@@ -157,22 +157,22 @@ public:
virtual ~FoFiType1C();
// Return the font name.
- char *getName();
+ const char *getName() const;
// Return the encoding, as an array of 256 names (any of which may
// be NULL). This is only useful with 8-bit fonts.
- char **getEncoding();
+ char **getEncoding() const;
// Get the glyph names.
- int getNumGlyphs() { return nGlyphs; }
- GooString *getGlyphName(int gid);
+ int getNumGlyphs() const { return nGlyphs; }
+ GooString *getGlyphName(int gid) const;
// Return the mapping from CIDs to GIDs, and return the number of
// CIDs in *<nCIDs>. This is only useful for CID fonts.
- int *getCIDToGIDMap(int *nCIDs);
+ int *getCIDToGIDMap(int *nCIDs) const;
// Return the font matrix as an array of six numbers.
- void getFontMatrix(double *mat);
+ void getFontMatrix(double *mat) const;
// Convert to a Type 1 font, suitable for embedding in a PostScript
// file. This is only useful with 8-bit fonts. If <newEncoding> is
@@ -180,7 +180,7 @@ public:
// font. If <ascii> is true the eexec section will be hex-encoded,
// otherwise it will be left as binary data. If <psName> is non-NULL,
// it will be used as the PostScript font name.
- void convertToType1(char *psName, const char **newEncoding, GBool ascii,
+ void convertToType1(const char *psName, const char **newEncoding, GBool ascii,
FoFiOutputFunc outputFunc, void *outputStream);
// Convert to a Type 0 CIDFont, suitable for embedding in a
@@ -233,8 +233,8 @@ private:
int getDeltaIntArray(int *arr, int maxLen);
int getDeltaFPArray(double *arr, int maxLen);
void getIndex(int pos, Type1CIndex *idx, GBool *ok);
- void getIndexVal(Type1CIndex *idx, int i, Type1CIndexVal *val, GBool *ok);
- char *getString(int sid, char *buf, GBool *ok);
+ void getIndexVal(const Type1CIndex *idx, int i, Type1CIndexVal *val, GBool *ok) const;
+ char *getString(int sid, char *buf, GBool *ok) const;
GooString *name;
char **encoding;