Skip to content
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

Update vendored Raqm to 0.10.1 #7087

Merged
merged 2 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/thirdparty/raqm/COPYING
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MIT License (MIT)

Copyright © 2015 Information Technology Authority (ITA) <foss@ita.gov.om>
Copyright © 2016-2022 Khaled Hosny <khaled@aliftype.com>
Copyright © 2016-2023 Khaled Hosny <khaled@aliftype.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
35 changes: 35 additions & 0 deletions src/thirdparty/raqm/NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
Overview of changes leading to 0.10.1
Wednesday, April 12, 2023
====================================

Make combining marks always inherit the script of their base.

Overview of changes leading to 0.10.0
Wednesday, January 11, 2023
====================================

Fix font feature ranges.

Fix resolved direction for all-neutral text.

Implement letter and word spacing support.

New API:
* raqm_set_text_utf16

Overview of changes leading to 0.9.0
Sunday, January 30, 2022
====================================

Raise the minimum versions of Raqm dependencies: no longer conditionally
enabling any features based on specific dependency version.

raqm_t objects can now be reused by calling raqm_clear_contents() before
re-use, to potentially reduce the number memory allocations.

Don't hardcode python3 in tests.

New API:
* raqm_set_freetype_load_flags_range
* raqm_clear_contents

Overview of changes leading to 0.8.0
Monday, December 13, 2021
====================================
Expand Down
2 changes: 1 addition & 1 deletion src/thirdparty/raqm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ The following projects have patches to support complex text layout using Raqm:
[1]: https://github.com/fribidi/fribidi
[2]: https://github.com/Tehreer/SheenBidi
[3]: https://github.com/harfbuzz/harfbuzz
[4]: https://www.freetype.org
[4]: https://freetype.org/
[5]: https://www.gtk.org/gtk-doc
4 changes: 2 additions & 2 deletions src/thirdparty/raqm/raqm-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

#define RAQM_VERSION_MAJOR 0
#define RAQM_VERSION_MINOR 10
#define RAQM_VERSION_MICRO 0
#define RAQM_VERSION_MICRO 1

#define RAQM_VERSION_STRING "0.10.0"
#define RAQM_VERSION_STRING "0.10.1"

#define RAQM_VERSION_ATLEAST(major,minor,micro) \
((major)*10000+(minor)*100+(micro) <= \
Expand Down
25 changes: 20 additions & 5 deletions src/thirdparty/raqm/raqm.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright © 2015 Information Technology Authority (ITA) <foss@ita.gov.om>
* Copyright © 2016-2022 Khaled Hosny <khaled@aliftype.com>
* Copyright © 2016-2023 Khaled Hosny <khaled@aliftype.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
Expand Down Expand Up @@ -1432,7 +1432,7 @@ raqm_get_glyphs (raqm_t *rq,
*
* Since: 0.8
*/
RAQM_API raqm_direction_t
raqm_direction_t
raqm_get_par_resolved_direction (raqm_t *rq)
{
if (!rq)
Expand All @@ -1455,7 +1455,7 @@ raqm_get_par_resolved_direction (raqm_t *rq)
*
* Since: 0.8
*/
RAQM_API raqm_direction_t
raqm_direction_t
raqm_get_direction_at_index (raqm_t *rq,
size_t index)
{
Expand Down Expand Up @@ -2021,6 +2021,22 @@ _get_pair_index (const uint32_t ch)
#define STACK_IS_EMPTY(script) ((script)->size <= 0)
#define IS_OPEN(pair_index) (((pair_index) & 1) == 0)

static hb_script_t
_raqm_unicode_script (hb_codepoint_t u)
{
static hb_unicode_funcs_t* unicode_funcs;

unicode_funcs = hb_unicode_funcs_get_default ();

/* Make combining marks inherit the script of their bases, regardless of
* their own script.
*/
if (hb_unicode_general_category (unicode_funcs, u) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
return HB_SCRIPT_INHERITED;

return hb_unicode_script (unicode_funcs, u);
}

/* Resolve the script for each character in the input string, if the character
* script is common or inherited it takes the script of the character before it
* except paired characters which we try to make them use the same script. We
Expand All @@ -2033,10 +2049,9 @@ _raqm_resolve_scripts (raqm_t *rq)
int last_set_index = -1;
hb_script_t last_script = HB_SCRIPT_INVALID;
_raqm_stack_t *stack = NULL;
hb_unicode_funcs_t* unicode_funcs = hb_unicode_funcs_get_default ();

for (size_t i = 0; i < rq->text_len; ++i)
rq->text_info[i].script = hb_unicode_script (unicode_funcs, rq->text[i]);
rq->text_info[i].script = _raqm_unicode_script (rq->text[i]);

#ifdef RAQM_TESTING
RAQM_TEST ("Before script detection:\n");
Expand Down
2 changes: 1 addition & 1 deletion src/thirdparty/raqm/raqm.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright © 2015 Information Technology Authority (ITA) <foss@ita.gov.om>
* Copyright © 2016-2022 Khaled Hosny <khaled@aliftype.com>
* Copyright © 2016-2023 Khaled Hosny <khaled@aliftype.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
Expand Down