-
-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Better Text Rendering for cairo / lua #1501
Open
simotek
wants to merge
24
commits into
brndnmtthws:main
Choose a base branch
from
simotek:lua-text-helper3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
2a0db1d
lua text: Supporting infra
simotek 79b81a6
lua text: initial implementation.
simotek 24706e8
Add the ability to center and right align text.
simotek d5d20e8
lua text: Remove test code
simotek b625e93
lua text: Supporting infra
simotek 4077ad5
lua text: initial implementation.
simotek 00b2ec0
Commit the WIP so I can merge it
simotek 5036cc4
Fix for #1698
simotek 488b450
Fix comment hb-unicode.h should be hb-common.h
simotek b0063e5
Swap to using optional parameters
simotek 945ce1f
Add Hack for RTL positioning
simotek dc7c0e0
Remove Top to Bottom Fixme's they are fixed
simotek ca1be94
Merge branch 'lua-text-helper2' into lua-text-helper3
simotek 47c45af
Some general cleanup post merge
simotek 7553faf
Attempt to fix workflows by adding freetype dep
simotek 2c74058
Probably actually need freetype6
simotek 7e2a662
Try again, I don't understand Ubuntu
simotek ac50fa7
Try something from google
simotek ba71b73
lua-text: Move to caching fonts in C
simotek 8f34c9d
Revert "Fix for #1698"
simotek 9ba643c
docs: tolua++ now works with more then lua5.1
simotek f4f7462
lua-text: Add docs.
simotek e5482ca
lua-text: Fix build with
simotek f9676c6
Merge branch 'main' into lua-text-helper3
simotek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
$#include <cairo.h> | ||
$#include <libcairo_text_helper.h> | ||
|
||
typedef struct _FontData { | ||
cairo_font_face_t *cairo_ft_face; | ||
hb_font_t *hb_ft_font; | ||
hb_face_t *hb_ft_face; | ||
int font_size; | ||
/* Internally the following two are pointers */ | ||
/* Stored here so they can be freed later */ | ||
FT_Library ft_library; | ||
FT_Face ft_face; | ||
}FontData; | ||
|
||
typedef enum _cairo_text_alignment { | ||
CAIRO_TEXT_ALIGN_LEFT = 0, | ||
CAIRO_TEXT_ALIGN_RIGHT, | ||
CAIRO_TEXT_ALIGN_CENTER | ||
} cairo_text_alignment_t; | ||
|
||
FontData * cairo_text_hp_load_font(const char *font, int font_size); | ||
|
||
void cairo_text_hp_destroy_font(FontData *font); | ||
|
||
void cairo_text_hp_simple_show(cairo_t *cr, int x, int y, const char *text, FontData *font); | ||
void cairo_text_hp_simple_show_center(cairo_t *cr, int x, int y, const char *text, FontData *font); | ||
void cairo_text_hp_simple_show_right(cairo_t *cr, int x, int y, const char *text, FontData *font); | ||
|
||
void cairo_text_hp_intl_show(cairo_t *cr, int x, int y, cairo_text_alignment_t alignment, const char *text, FontData *font, | ||
const char *direction, const char *script, const char *language); | ||
|
||
int cairo_text_hp_text_width(const char *text, FontData *font, | ||
const char *direction, const char *script, const char *language); | ||
|
||
int cairo_text_hp_simple_text_width(const char *text, FontData *font); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably enable this in the macos build too, if you want to take a stab at that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once I figure out why the ubuntu builds are failing i'll have a shot at enabling it.