diff --git a/NEWS.md b/NEWS.md index ee6b09f..13b100d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # systemfonts (development version) +* Fix a bug in `shape_string()` using `vjust = 1` (#85) + # systemfonts 1.0.4 * Use Courier New as default mono font on macOS instead of Courier to avoid diff --git a/src/string_shape.cpp b/src/string_shape.cpp index c84a1f7..6119f9c 100644 --- a/src/string_shape.cpp +++ b/src/string_shape.cpp @@ -249,7 +249,7 @@ bool FreetypeShaper::finish_string() { x_pos[i] += left_border; } } - if (cur_vjust != 1.0) { + if (cur_vjust != 0.0) { long just_height = top_border - pen_y; for (unsigned int i = 0; i < x_pos.size(); ++i) { y_pos[i] += - pen_y - cur_vjust * just_height;