Skip to content

Commit

Permalink
Font regeneration for native and zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
suyjuris committed May 4, 2019
1 parent 6f09854 commit 77de7e1
Show file tree
Hide file tree
Showing 5 changed files with 820 additions and 87 deletions.
3 changes: 3 additions & 0 deletions global.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,6 @@ bool bitset_get(Array_t<u64> bitset, u64 bit) {
u64 offset = bit % 64;
return bitset[index] >> offset & 1;
}

#define JUP_STOX_IMPLEMENTATION
#include "stox.hpp"
8 changes: 0 additions & 8 deletions obst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ enum errorcode : u8 {

}

char const* jup_err_messages[] = {
/* 0 */ nullptr,
/* 1 */ "String is empty",
/* 2 */ "Invalid character",
/* 3 */ "Out of range (too low)",
/* 4 */ "Out of range (too high)",
};

// Parse an integer in str into val using base base. Is pretty defensive about what kind of strings
// it accepts.
u8 jup_stoi(Array_t<u8> str, s32* val, s64 base) {
Expand Down
3 changes: 3 additions & 0 deletions platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct Key {
INVALID, ESCAPE, ARROW_L, ARROW_R, ARROW_D, ARROW_U,
HOME, END, PAGE_U, PAGE_D, TAB, SHIFT_TAB, DELETE, BACKSPACE, RETURN,
C_COPY, C_PASTE, C_CUT, C_SELECTALL, C_UNDO, C_REDO, C_QUIT, C_SAVE,
C_ZOOM_IN, C_ZOOM_OUT, C_ZOOM_ZERO,
F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,
SPECIAL_COUNT
};
Expand Down Expand Up @@ -133,6 +134,8 @@ struct Text_box {
float advance = 0.f;
u8 font;
u32 flags = 0; // Same as the spacing flags in Text_fmt::Flags
float letter_fac = 1.f;
s64 word_offset = 0, word_size = 0; // Bytes of the word, in Text_preperation::word_data

static_assert(Text_fmt::GROUP_SPACING >> 32 == 0, "32-bit not sufficient or Text_box flags");
};
Expand Down
Loading

0 comments on commit 77de7e1

Please sign in to comment.