[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 02/16: [libgroff]: Rename font class member variable.
From: |
G. Branden Robinson |
Subject: |
[groff] 02/16: [libgroff]: Rename font class member variable. |
Date: |
Mon, 23 Aug 2021 00:06:39 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 8ce8ca92c792d670628b8457f1b8519f630e0cbf
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Aug 21 09:24:01 2021 +1000
[libgroff]: Rename font class member variable.
* src/include/font.h (font class): Rename `unscaled_charwidths` member
variable to `use_unscaled_charwidths`: since it is a Boolean, make it
read more like a logical predicate.
* src/libs/libgroff/font.cpp (font::get_width, font::load_desc):
* src/libs/libgroff/fontfile.cpp (font class): Update initialization and
assignments.
Continues 749502cc, 13 August 2021.
---
ChangeLog | 12 ++++++++++++
src/include/font.h | 2 +-
src/libs/libgroff/font.cpp | 6 +++---
src/libs/libgroff/fontfile.cpp | 2 +-
4 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b34fbec..d2633f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2021-08-21 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [libgroff]: Rename font class member variable.
+
+ * src/include/font.h (font class): Rename `unscaled_charwidths`
+ member variable to `use_unscaled_charwidths`: since it is a
+ Boolean, make it read more like a logical predicate.
+
+ * src/libs/libgroff/font.cpp (font::get_width, font::load_desc):
+ * src/libs/libgroff/fontfile.cpp (font class): Update
+ initialization and assignments.
+
2021-08-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp (get_copy): Demote integer arguments
diff --git a/src/include/font.h b/src/include/font.h
index 2b6fe48..95c489d 100644
--- a/src/include/font.h
+++ b/src/include/font.h
@@ -244,7 +244,7 @@ public:
static int spare2;
static int sizescale; // The 'sizescale' attribute given in the DESC
file.
static bool has_tcommand; // DESC file has 'tcommand' directive.
- static bool unscaled_charwidths; // DESC file has
+ static bool use_unscaled_charwidths; // DESC file has
// 'unscaled_charwidths' directive.
static bool pass_filenames; // DESC file has 'pass_filenames'
// directive.
diff --git a/src/libs/libgroff/font.cpp b/src/libs/libgroff/font.cpp
index 588acab..eb28048 100644
--- a/src/libs/libgroff/font.cpp
+++ b/src/libs/libgroff/font.cpp
@@ -355,7 +355,7 @@ int font::get_width(glyph *g, int point_size)
if (idx < nindices && ch_index[idx] >= 0) {
// Explicitly enumerated glyph
int i = ch_index[idx];
- if (real_size == unitwidth || font::unscaled_charwidths)
+ if (real_size == unitwidth || font::use_unscaled_charwidths)
return ch[i].width;
if (!widths_cache)
@@ -386,7 +386,7 @@ int font::get_width(glyph *g, int point_size)
int w = wcwidth(get_code(g));
if (w > 1)
width *= w;
- if (real_size == unitwidth || font::unscaled_charwidths)
+ if (real_size == unitwidth || font::use_unscaled_charwidths)
return width;
else
return scale(width, point_size);
@@ -1121,7 +1121,7 @@ int font::load_desc()
}
}
else if (strcmp("unscaled_charwidths", p) == 0)
- unscaled_charwidths = true;
+ use_unscaled_charwidths = true;
else if (strcmp("pass_filenames", p) == 0)
pass_filenames = true;
else if (strcmp("sizes", p) == 0) {
diff --git a/src/libs/libgroff/fontfile.cpp b/src/libs/libgroff/fontfile.cpp
index ad5e0c4..3b375f2 100644
--- a/src/libs/libgroff/fontfile.cpp
+++ b/src/libs/libgroff/fontfile.cpp
@@ -43,7 +43,7 @@ int font::spare2 = 0;
int font::sizescale = 1;
bool font::has_tcommand = false;
bool font::pass_filenames = false;
-bool font::unscaled_charwidths = false;
+bool font::use_unscaled_charwidths = false;
bool font::use_charnames_in_special = false;
bool font::is_unicode = false;
const char *font::image_generator = NULL;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 02/16: [libgroff]: Rename font class member variable.,
G. Branden Robinson <=