From bf338b23648099e6633ece394502cc963c287ffb Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 5 Oct 2017 11:58:45 +0300 Subject: [PATCH] BiDi and shaping for DynamicFont and BitmapFont and complex controls (LineEdit, Label), line breaking and line justification using ICU and HarfBuzz libraries. --- COPYRIGHT.txt | 93 + SConstruct | 6 + core/global_constants.cpp | 15 + core/math/math_defs.h | 24 + core/method_bind.h | 3 + core/ustring.cpp | 30 +- core/ustring.h | 6 +- doc/classes/@GlobalScope.xml | 36 + doc/classes/CanvasItem.xml | 21 + doc/classes/ICUData.xml | 16 + doc/classes/Label.xml | 12 +- doc/classes/LineEdit.xml | 10 + doc/classes/ProjectSettings.xml | 3 + doc/classes/ShapedAttributedString.xml | 109 + doc/classes/ShapedString.xml | 292 + drivers/SCsub | 6 + drivers/harfbuzz/SCsub | 96 + drivers/harfbuzz/src/hb-bitmap.cc | 201 + drivers/harfbuzz/src/hb-bitmap.h | 44 + drivers/icu4c/SCsub | 271 + editor/editor_themes.cpp | 20 + editor/icons/icon_i_c_u_data.svg | 1 + editor/icons/icon_label_legacy.svg | 1 + editor/icons/icon_legacy_control.svg | 1 + editor/icons/icon_line_edit_legacy.svg | 1 + .../icons/icon_shaped_attributed_string.svg | 1 + editor/icons/icon_shaped_string.svg | 1 + editor/output_strings.cpp | 16 +- main/main.cpp | 3 + main/tests/test_main.cpp | 8 + main/tests/test_shaping.cpp | 148 + main/tests/test_shaping.h | 45 + platform/javascript/detect.py | 7 +- platform/x11/detect.py | 6 + scene/2d/canvas_item.cpp | 12 + scene/2d/canvas_item.h | 5 +- scene/SCsub | 1 + scene/gui/item_list.cpp | 35 +- scene/gui/label.cpp | 505 +- scene/gui/label.h | 46 +- scene/gui/legacy/SCsub | 5 + scene/gui/legacy/label_legacy.cpp | 710 ++ scene/gui/legacy/label_legacy.h | 153 + scene/gui/legacy/legacy.h | 44 + scene/gui/legacy/line_edit_legacy.cpp | 1646 +++++ scene/gui/legacy/line_edit_legacy.h | 229 + scene/gui/line_edit.cpp | 457 +- scene/gui/line_edit.h | 18 +- scene/register_scene_types.cpp | 31 + .../resources/default_theme/default_theme.cpp | 33 + scene/resources/dynamic_font.cpp | 135 +- scene/resources/dynamic_font.h | 25 +- scene/resources/font.cpp | 229 +- scene/resources/font.h | 38 +- scene/resources/icu_data.cpp | 163 + scene/resources/icu_data.h | 78 + scene/resources/shaped_attributed_string.cpp | 1025 +++ scene/resources/shaped_attributed_string.h | 107 + scene/resources/shaped_string.cpp | 2317 +++++++ scene/resources/shaped_string.h | 335 + thirdparty/README.md | 24 + thirdparty/harfbuzz/AUTHORS | 9 + thirdparty/harfbuzz/COPYING | 36 + thirdparty/harfbuzz/NEWS | 1952 ++++++ thirdparty/harfbuzz/README | 17 + thirdparty/harfbuzz/THANKS | 7 + .../harfbuzz/src/hb-aat-layout-ankr-table.hh | 82 + .../harfbuzz/src/hb-aat-layout-bsln-table.hh | 157 + .../src/hb-aat-layout-common-private.hh | 644 ++ .../harfbuzz/src/hb-aat-layout-feat-table.hh | 120 + .../harfbuzz/src/hb-aat-layout-kerx-table.hh | 346 + .../harfbuzz/src/hb-aat-layout-morx-table.hh | 735 +++ .../harfbuzz/src/hb-aat-layout-private.hh | 43 + .../harfbuzz/src/hb-aat-layout-trak-table.hh | 211 + thirdparty/harfbuzz/src/hb-aat-layout.cc | 96 + thirdparty/harfbuzz/src/hb-aat-ltag-table.hh | 79 + thirdparty/harfbuzz/src/hb-atomic-private.hh | 281 + thirdparty/harfbuzz/src/hb-blob-private.hh | 82 + thirdparty/harfbuzz/src/hb-blob.cc | 644 ++ thirdparty/harfbuzz/src/hb-blob.h | 131 + .../src/hb-buffer-deserialize-json.hh | 643 ++ .../src/hb-buffer-deserialize-json.rl | 132 + .../src/hb-buffer-deserialize-text.hh | 571 ++ .../src/hb-buffer-deserialize-text.rl | 126 + thirdparty/harfbuzz/src/hb-buffer-private.hh | 389 ++ .../harfbuzz/src/hb-buffer-serialize.cc | 486 ++ thirdparty/harfbuzz/src/hb-buffer.cc | 2015 ++++++ thirdparty/harfbuzz/src/hb-buffer.h | 562 ++ thirdparty/harfbuzz/src/hb-common.cc | 1082 ++++ thirdparty/harfbuzz/src/hb-common.h | 418 ++ thirdparty/harfbuzz/src/hb-debug.hh | 487 ++ thirdparty/harfbuzz/src/hb-deprecated.h | 65 + thirdparty/harfbuzz/src/hb-dsalgs.hh | 607 ++ thirdparty/harfbuzz/src/hb-face-private.hh | 108 + thirdparty/harfbuzz/src/hb-face.cc | 514 ++ thirdparty/harfbuzz/src/hb-face.h | 125 + thirdparty/harfbuzz/src/hb-fallback-shape.cc | 149 + thirdparty/harfbuzz/src/hb-font-private.hh | 604 ++ thirdparty/harfbuzz/src/hb-font.cc | 1971 ++++++ thirdparty/harfbuzz/src/hb-font.h | 706 ++ thirdparty/harfbuzz/src/hb-ft.cc | 793 +++ thirdparty/harfbuzz/src/hb-ft.h | 132 + thirdparty/harfbuzz/src/hb-graphite2.cc | 425 ++ thirdparty/harfbuzz/src/hb-graphite2.h | 52 + thirdparty/harfbuzz/src/hb-icu.cc | 389 ++ thirdparty/harfbuzz/src/hb-icu.h | 52 + thirdparty/harfbuzz/src/hb-iter-private.hh | 149 + .../harfbuzz/src/hb-machinery-private.hh | 792 +++ thirdparty/harfbuzz/src/hb-map-private.hh | 254 + thirdparty/harfbuzz/src/hb-map.cc | 259 + thirdparty/harfbuzz/src/hb-map.h | 104 + thirdparty/harfbuzz/src/hb-mutex-private.hh | 141 + thirdparty/harfbuzz/src/hb-null.hh | 106 + thirdparty/harfbuzz/src/hb-object-private.hh | 325 + .../harfbuzz/src/hb-open-file-private.hh | 568 ++ .../harfbuzz/src/hb-open-type-private.hh | 649 ++ thirdparty/harfbuzz/src/hb-ot-cbdt-table.hh | 471 ++ thirdparty/harfbuzz/src/hb-ot-cmap-table.hh | 1091 ++++ .../harfbuzz/src/hb-ot-color-cbdt-table.hh | 538 ++ .../harfbuzz/src/hb-ot-color-colr-table.hh | 144 + .../harfbuzz/src/hb-ot-color-cpal-table.hh | 224 + .../harfbuzz/src/hb-ot-color-sbix-table.hh | 147 + .../harfbuzz/src/hb-ot-color-svg-table.hh | 143 + thirdparty/harfbuzz/src/hb-ot-color.cc | 183 + thirdparty/harfbuzz/src/hb-ot-font.cc | 294 + thirdparty/harfbuzz/src/hb-ot-font.h | 45 + thirdparty/harfbuzz/src/hb-ot-glyf-table.hh | 496 ++ thirdparty/harfbuzz/src/hb-ot-hdmx-table.hh | 219 + thirdparty/harfbuzz/src/hb-ot-head-table.hh | 154 + thirdparty/harfbuzz/src/hb-ot-hhea-table.hh | 99 + thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh | 338 + thirdparty/harfbuzz/src/hb-ot-kern-table.hh | 396 ++ .../harfbuzz/src/hb-ot-layout-base-table.hh | 629 ++ .../src/hb-ot-layout-common-private.hh | 1806 ++++++ .../harfbuzz/src/hb-ot-layout-gdef-table.hh | 461 ++ .../harfbuzz/src/hb-ot-layout-gpos-table.hh | 1658 +++++ .../harfbuzz/src/hb-ot-layout-gsub-table.hh | 1385 ++++ .../src/hb-ot-layout-gsubgpos-private.hh | 2406 +++++++ .../harfbuzz/src/hb-ot-layout-jstf-table.hh | 235 + .../harfbuzz/src/hb-ot-layout-private.hh | 704 ++ thirdparty/harfbuzz/src/hb-ot-layout.cc | 1345 ++++ thirdparty/harfbuzz/src/hb-ot-layout.h | 351 + thirdparty/harfbuzz/src/hb-ot-map-private.hh | 253 + thirdparty/harfbuzz/src/hb-ot-map.cc | 335 + thirdparty/harfbuzz/src/hb-ot-math-table.hh | 725 +++ thirdparty/harfbuzz/src/hb-ot-math.cc | 253 + thirdparty/harfbuzz/src/hb-ot-math.h | 209 + thirdparty/harfbuzz/src/hb-ot-maxp-table.hh | 149 + thirdparty/harfbuzz/src/hb-ot-name-table.hh | 138 + thirdparty/harfbuzz/src/hb-ot-os2-table.hh | 182 + .../harfbuzz/src/hb-ot-os2-unicode-ranges.hh | 246 + .../harfbuzz/src/hb-ot-post-macroman.hh | 294 + thirdparty/harfbuzz/src/hb-ot-post-table.hh | 301 + .../hb-ot-shape-complex-arabic-fallback.hh | 354 + .../src/hb-ot-shape-complex-arabic-private.hh | 50 + .../src/hb-ot-shape-complex-arabic-table.hh | 425 ++ .../src/hb-ot-shape-complex-arabic-win1256.hh | 323 + .../src/hb-ot-shape-complex-arabic.cc | 721 +++ .../src/hb-ot-shape-complex-default.cc | 46 + .../src/hb-ot-shape-complex-hangul.cc | 431 ++ .../src/hb-ot-shape-complex-hebrew.cc | 186 + .../src/hb-ot-shape-complex-indic-machine.hh | 1319 ++++ .../src/hb-ot-shape-complex-indic-machine.rl | 125 + .../src/hb-ot-shape-complex-indic-private.hh | 403 ++ .../src/hb-ot-shape-complex-indic-table.cc | 487 ++ .../harfbuzz/src/hb-ot-shape-complex-indic.cc | 1622 +++++ .../src/hb-ot-shape-complex-khmer-machine.hh | 294 + .../src/hb-ot-shape-complex-khmer-machine.rl | 107 + .../src/hb-ot-shape-complex-khmer-private.hh | 124 + .../harfbuzz/src/hb-ot-shape-complex-khmer.cc | 508 ++ .../hb-ot-shape-complex-myanmar-machine.hh | 413 ++ .../hb-ot-shape-complex-myanmar-machine.rl | 129 + .../hb-ot-shape-complex-myanmar-private.hh | 171 + .../src/hb-ot-shape-complex-myanmar.cc | 401 ++ .../src/hb-ot-shape-complex-private.hh | 393 ++ .../harfbuzz/src/hb-ot-shape-complex-thai.cc | 383 ++ .../src/hb-ot-shape-complex-tibetan.cc | 63 + .../src/hb-ot-shape-complex-use-machine.hh | 502 ++ .../src/hb-ot-shape-complex-use-machine.rl | 176 + .../src/hb-ot-shape-complex-use-private.hh | 97 + .../src/hb-ot-shape-complex-use-table.cc | 816 +++ .../harfbuzz/src/hb-ot-shape-complex-use.cc | 593 ++ .../src/hb-ot-shape-fallback-private.hh | 53 + .../harfbuzz/src/hb-ot-shape-fallback.cc | 559 ++ .../src/hb-ot-shape-normalize-private.hh | 69 + .../harfbuzz/src/hb-ot-shape-normalize.cc | 433 ++ .../harfbuzz/src/hb-ot-shape-private.hh | 112 + thirdparty/harfbuzz/src/hb-ot-shape.cc | 969 +++ thirdparty/harfbuzz/src/hb-ot-shape.h | 53 + thirdparty/harfbuzz/src/hb-ot-tag.cc | 1093 ++++ thirdparty/harfbuzz/src/hb-ot-tag.h | 59 + .../harfbuzz/src/hb-ot-var-avar-table.hh | 151 + .../harfbuzz/src/hb-ot-var-fvar-table.hh | 212 + .../harfbuzz/src/hb-ot-var-hvar-table.hh | 166 + .../harfbuzz/src/hb-ot-var-mvar-table.hh | 114 + thirdparty/harfbuzz/src/hb-ot-var.cc | 159 + thirdparty/harfbuzz/src/hb-ot-var.h | 105 + thirdparty/harfbuzz/src/hb-ot.h | 45 + thirdparty/harfbuzz/src/hb-private.hh | 480 ++ .../harfbuzz/src/hb-set-digest-private.hh | 179 + thirdparty/harfbuzz/src/hb-set-private.hh | 700 ++ thirdparty/harfbuzz/src/hb-set.cc | 530 ++ thirdparty/harfbuzz/src/hb-set.h | 167 + .../harfbuzz/src/hb-shape-plan-private.hh | 67 + thirdparty/harfbuzz/src/hb-shape-plan.cc | 582 ++ thirdparty/harfbuzz/src/hb-shape-plan.h | 108 + thirdparty/harfbuzz/src/hb-shape.cc | 168 + thirdparty/harfbuzz/src/hb-shape.h | 62 + .../harfbuzz/src/hb-shaper-impl-private.hh | 43 + thirdparty/harfbuzz/src/hb-shaper-list.hh | 58 + thirdparty/harfbuzz/src/hb-shaper-private.hh | 134 + thirdparty/harfbuzz/src/hb-shaper.cc | 110 + thirdparty/harfbuzz/src/hb-static.cc | 66 + thirdparty/harfbuzz/src/hb-string-array.hh | 81 + thirdparty/harfbuzz/src/hb-subset-glyf.cc | 311 + thirdparty/harfbuzz/src/hb-subset-glyf.hh | 40 + thirdparty/harfbuzz/src/hb-subset-input.cc | 135 + thirdparty/harfbuzz/src/hb-subset-plan.cc | 191 + thirdparty/harfbuzz/src/hb-subset-plan.hh | 106 + thirdparty/harfbuzz/src/hb-subset-private.hh | 63 + thirdparty/harfbuzz/src/hb-subset.cc | 380 ++ thirdparty/harfbuzz/src/hb-subset.h | 89 + thirdparty/harfbuzz/src/hb-unicode-private.hh | 369 ++ thirdparty/harfbuzz/src/hb-unicode.cc | 564 ++ thirdparty/harfbuzz/src/hb-unicode.h | 471 ++ thirdparty/harfbuzz/src/hb-utf-private.hh | 282 + thirdparty/harfbuzz/src/hb-vector-private.hh | 238 + thirdparty/harfbuzz/src/hb-version.h | 66 + thirdparty/harfbuzz/src/hb-warning.cc | 37 + thirdparty/harfbuzz/src/hb.h | 52 + thirdparty/icu4c/APIChangeReport.html | 1384 ++++ thirdparty/icu4c/LICENSE | 414 ++ thirdparty/icu4c/icu4c.css | 515 ++ thirdparty/icu4c/license.html | 18 + thirdparty/icu4c/readme.html | 1893 ++++++ thirdparty/icu4c/source/common/appendable.cpp | 74 + thirdparty/icu4c/source/common/bmpset.cpp | 741 +++ thirdparty/icu4c/source/common/bmpset.h | 164 + thirdparty/icu4c/source/common/brkeng.cpp | 285 + thirdparty/icu4c/source/common/brkeng.h | 271 + thirdparty/icu4c/source/common/brkiter.cpp | 508 ++ .../icu4c/source/common/bytesinkutil.cpp | 123 + thirdparty/icu4c/source/common/bytesinkutil.h | 61 + thirdparty/icu4c/source/common/bytestream.cpp | 85 + thirdparty/icu4c/source/common/bytestrie.cpp | 441 ++ .../icu4c/source/common/bytestriebuilder.cpp | 503 ++ .../icu4c/source/common/bytestrieiterator.cpp | 214 + thirdparty/icu4c/source/common/caniter.cpp | 586 ++ thirdparty/icu4c/source/common/chariter.cpp | 100 + thirdparty/icu4c/source/common/charstr.cpp | 186 + thirdparty/icu4c/source/common/charstr.h | 153 + thirdparty/icu4c/source/common/cmemory.cpp | 138 + thirdparty/icu4c/source/common/cmemory.h | 677 ++ thirdparty/icu4c/source/common/common.rc | 110 + thirdparty/icu4c/source/common/cpputils.h | 97 + thirdparty/icu4c/source/common/cstr.cpp | 54 + thirdparty/icu4c/source/common/cstr.h | 60 + thirdparty/icu4c/source/common/cstring.cpp | 341 + thirdparty/icu4c/source/common/cstring.h | 124 + thirdparty/icu4c/source/common/cwchar.cpp | 55 + thirdparty/icu4c/source/common/cwchar.h | 58 + thirdparty/icu4c/source/common/dictbe.cpp | 1392 ++++ thirdparty/icu4c/source/common/dictbe.h | 402 ++ .../icu4c/source/common/dictionarydata.cpp | 242 + .../icu4c/source/common/dictionarydata.h | 191 + thirdparty/icu4c/source/common/dtintrv.cpp | 63 + thirdparty/icu4c/source/common/edits.cpp | 803 +++ thirdparty/icu4c/source/common/errorcode.cpp | 42 + .../icu4c/source/common/filteredbrk.cpp | 710 ++ .../source/common/filterednormalizer2.cpp | 363 ++ thirdparty/icu4c/source/common/hash.h | 248 + thirdparty/icu4c/source/common/icudataver.cpp | 31 + thirdparty/icu4c/source/common/icuplug.cpp | 884 +++ thirdparty/icu4c/source/common/icuplugimp.h | 93 + .../icu4c/source/common/listformatter.cpp | 429 ++ .../source/common/loadednormalizer2impl.cpp | 359 ++ thirdparty/icu4c/source/common/localsvc.h | 27 + .../icu4c/source/common/locavailable.cpp | 181 + thirdparty/icu4c/source/common/locbased.cpp | 55 + thirdparty/icu4c/source/common/locbased.h | 107 + .../icu4c/source/common/locdispnames.cpp | 886 +++ thirdparty/icu4c/source/common/locdspnm.cpp | 1058 +++ thirdparty/icu4c/source/common/locid.cpp | 1057 +++ thirdparty/icu4c/source/common/loclikely.cpp | 1386 ++++ thirdparty/icu4c/source/common/locmap.cpp | 1320 ++++ thirdparty/icu4c/source/common/locmap.h | 40 + thirdparty/icu4c/source/common/locresdata.cpp | 225 + thirdparty/icu4c/source/common/locutil.cpp | 275 + thirdparty/icu4c/source/common/locutil.h | 39 + thirdparty/icu4c/source/common/messageimpl.h | 65 + .../icu4c/source/common/messagepattern.cpp | 1233 ++++ thirdparty/icu4c/source/common/msvcres.h | 25 + thirdparty/icu4c/source/common/mutex.h | 79 + .../icu4c/source/common/norm2_nfc_data.h | 1169 ++++ .../icu4c/source/common/norm2allmodes.h | 369 ++ .../icu4c/source/common/normalizer2.cpp | 566 ++ .../icu4c/source/common/normalizer2impl.cpp | 2692 ++++++++ .../icu4c/source/common/normalizer2impl.h | 952 +++ thirdparty/icu4c/source/common/normlzr.cpp | 529 ++ thirdparty/icu4c/source/common/parsepos.cpp | 23 + .../icu4c/source/common/patternprops.cpp | 220 + thirdparty/icu4c/source/common/patternprops.h | 91 + thirdparty/icu4c/source/common/pluralmap.cpp | 44 + thirdparty/icu4c/source/common/pluralmap.h | 292 + thirdparty/icu4c/source/common/propname.cpp | 328 + thirdparty/icu4c/source/common/propname.h | 212 + .../icu4c/source/common/propname_data.h | 1749 +++++ thirdparty/icu4c/source/common/propsvec.cpp | 529 ++ thirdparty/icu4c/source/common/propsvec.h | 178 + thirdparty/icu4c/source/common/punycode.cpp | 589 ++ thirdparty/icu4c/source/common/punycode.h | 120 + thirdparty/icu4c/source/common/putil.cpp | 2499 +++++++ thirdparty/icu4c/source/common/putilimp.h | 638 ++ thirdparty/icu4c/source/common/rbbi.cpp | 1272 ++++ thirdparty/icu4c/source/common/rbbi_cache.cpp | 658 ++ thirdparty/icu4c/source/common/rbbi_cache.h | 203 + thirdparty/icu4c/source/common/rbbicst.pl | 459 ++ thirdparty/icu4c/source/common/rbbidata.cpp | 425 ++ thirdparty/icu4c/source/common/rbbidata.h | 197 + thirdparty/icu4c/source/common/rbbinode.cpp | 372 ++ thirdparty/icu4c/source/common/rbbinode.h | 127 + thirdparty/icu4c/source/common/rbbirb.cpp | 321 + thirdparty/icu4c/source/common/rbbirb.h | 237 + thirdparty/icu4c/source/common/rbbirpt.h | 296 + thirdparty/icu4c/source/common/rbbirpt.txt | 337 + thirdparty/icu4c/source/common/rbbiscan.cpp | 1279 ++++ thirdparty/icu4c/source/common/rbbiscan.h | 165 + thirdparty/icu4c/source/common/rbbisetb.cpp | 684 ++ thirdparty/icu4c/source/common/rbbisetb.h | 147 + thirdparty/icu4c/source/common/rbbistbl.cpp | 270 + thirdparty/icu4c/source/common/rbbitblb.cpp | 1679 +++++ thirdparty/icu4c/source/common/rbbitblb.h | 207 + thirdparty/icu4c/source/common/resbund.cpp | 398 ++ .../icu4c/source/common/resbund_cnv.cpp | 57 + thirdparty/icu4c/source/common/resource.cpp | 22 + thirdparty/icu4c/source/common/resource.h | 279 + thirdparty/icu4c/source/common/ruleiter.cpp | 162 + thirdparty/icu4c/source/common/ruleiter.h | 233 + thirdparty/icu4c/source/common/schriter.cpp | 119 + thirdparty/icu4c/source/common/serv.cpp | 982 +++ thirdparty/icu4c/source/common/serv.h | 996 +++ thirdparty/icu4c/source/common/servlk.cpp | 188 + thirdparty/icu4c/source/common/servlkf.cpp | 152 + thirdparty/icu4c/source/common/servloc.h | 551 ++ thirdparty/icu4c/source/common/servls.cpp | 295 + thirdparty/icu4c/source/common/servnotf.cpp | 120 + thirdparty/icu4c/source/common/servnotf.h | 125 + thirdparty/icu4c/source/common/servrbf.cpp | 96 + thirdparty/icu4c/source/common/servslkf.cpp | 123 + .../icu4c/source/common/sharedobject.cpp | 62 + thirdparty/icu4c/source/common/sharedobject.h | 184 + .../icu4c/source/common/simpleformatter.cpp | 314 + thirdparty/icu4c/source/common/sprpimpl.h | 130 + .../source/common/static_unicode_sets.cpp | 222 + .../icu4c/source/common/static_unicode_sets.h | 119 + .../icu4c/source/common/stringpiece.cpp | 75 + .../icu4c/source/common/stringtriebuilder.cpp | 618 ++ thirdparty/icu4c/source/common/uarrsort.cpp | 288 + thirdparty/icu4c/source/common/uarrsort.h | 103 + thirdparty/icu4c/source/common/uassert.h | 34 + thirdparty/icu4c/source/common/ubidi.cpp | 3039 +++++++++ .../icu4c/source/common/ubidi_props.cpp | 254 + thirdparty/icu4c/source/common/ubidi_props.h | 148 + .../icu4c/source/common/ubidi_props_data.h | 894 +++ thirdparty/icu4c/source/common/ubidiimp.h | 468 ++ thirdparty/icu4c/source/common/ubidiln.cpp | 1349 ++++ .../icu4c/source/common/ubiditransform.cpp | 530 ++ thirdparty/icu4c/source/common/ubidiwrt.cpp | 640 ++ thirdparty/icu4c/source/common/ubrk.cpp | 357 + thirdparty/icu4c/source/common/ubrkimpl.h | 15 + thirdparty/icu4c/source/common/ucase.cpp | 1570 +++++ thirdparty/icu4c/source/common/ucase.h | 444 ++ .../icu4c/source/common/ucase_props_data.h | 931 +++ thirdparty/icu4c/source/common/ucasemap.cpp | 953 +++ thirdparty/icu4c/source/common/ucasemap_imp.h | 282 + .../common/ucasemap_titlecase_brkiter.cpp | 134 + thirdparty/icu4c/source/common/ucat.cpp | 78 + thirdparty/icu4c/source/common/uchar.cpp | 725 +++ .../icu4c/source/common/uchar_props_data.h | 3707 +++++++++++ thirdparty/icu4c/source/common/ucharstrie.cpp | 414 ++ .../icu4c/source/common/ucharstriebuilder.cpp | 443 ++ .../source/common/ucharstrieiterator.cpp | 215 + thirdparty/icu4c/source/common/uchriter.cpp | 367 ++ thirdparty/icu4c/source/common/ucln.h | 91 + thirdparty/icu4c/source/common/ucln_cmn.cpp | 113 + thirdparty/icu4c/source/common/ucln_cmn.h | 74 + thirdparty/icu4c/source/common/ucln_imp.h | 182 + thirdparty/icu4c/source/common/ucmndata.cpp | 393 ++ thirdparty/icu4c/source/common/ucmndata.h | 117 + thirdparty/icu4c/source/common/ucnv.cpp | 2918 +++++++++ thirdparty/icu4c/source/common/ucnv2022.cpp | 3978 ++++++++++++ thirdparty/icu4c/source/common/ucnv_bld.cpp | 1689 +++++ thirdparty/icu4c/source/common/ucnv_bld.h | 296 + thirdparty/icu4c/source/common/ucnv_cb.cpp | 261 + thirdparty/icu4c/source/common/ucnv_cnv.cpp | 182 + thirdparty/icu4c/source/common/ucnv_cnv.h | 323 + thirdparty/icu4c/source/common/ucnv_ct.cpp | 646 ++ thirdparty/icu4c/source/common/ucnv_err.cpp | 486 ++ thirdparty/icu4c/source/common/ucnv_ext.cpp | 1143 ++++ thirdparty/icu4c/source/common/ucnv_ext.h | 481 ++ thirdparty/icu4c/source/common/ucnv_imp.h | 139 + thirdparty/icu4c/source/common/ucnv_io.cpp | 1360 ++++ thirdparty/icu4c/source/common/ucnv_io.h | 127 + thirdparty/icu4c/source/common/ucnv_lmb.cpp | 1386 ++++ thirdparty/icu4c/source/common/ucnv_set.cpp | 70 + thirdparty/icu4c/source/common/ucnv_u16.cpp | 1579 +++++ thirdparty/icu4c/source/common/ucnv_u32.cpp | 1253 ++++ thirdparty/icu4c/source/common/ucnv_u7.cpp | 1491 +++++ thirdparty/icu4c/source/common/ucnv_u8.cpp | 944 +++ thirdparty/icu4c/source/common/ucnvbocu.cpp | 1413 ++++ thirdparty/icu4c/source/common/ucnvdisp.cpp | 88 + thirdparty/icu4c/source/common/ucnvhz.cpp | 633 ++ thirdparty/icu4c/source/common/ucnvisci.cpp | 1635 +++++ thirdparty/icu4c/source/common/ucnvlat1.cpp | 756 +++ thirdparty/icu4c/source/common/ucnvmbcs.cpp | 5723 +++++++++++++++++ thirdparty/icu4c/source/common/ucnvmbcs.h | 605 ++ thirdparty/icu4c/source/common/ucnvscsu.cpp | 2045 ++++++ thirdparty/icu4c/source/common/ucnvsel.cpp | 822 +++ thirdparty/icu4c/source/common/ucol_data.h | 89 + thirdparty/icu4c/source/common/ucol_swp.cpp | 690 ++ thirdparty/icu4c/source/common/ucol_swp.h | 58 + thirdparty/icu4c/source/common/ucurr.cpp | 2732 ++++++++ thirdparty/icu4c/source/common/ucurrimp.h | 78 + thirdparty/icu4c/source/common/udata.cpp | 1436 +++++ thirdparty/icu4c/source/common/udatamem.cpp | 161 + thirdparty/icu4c/source/common/udatamem.h | 61 + thirdparty/icu4c/source/common/udataswp.cpp | 473 ++ thirdparty/icu4c/source/common/udataswp.h | 367 ++ thirdparty/icu4c/source/common/uelement.h | 91 + thirdparty/icu4c/source/common/uenum.cpp | 189 + thirdparty/icu4c/source/common/uenumimp.h | 155 + thirdparty/icu4c/source/common/uhash.cpp | 991 +++ thirdparty/icu4c/source/common/uhash.h | 718 +++ thirdparty/icu4c/source/common/uhash_us.cpp | 26 + thirdparty/icu4c/source/common/uidna.cpp | 922 +++ thirdparty/icu4c/source/common/uinit.cpp | 74 + thirdparty/icu4c/source/common/uinvchar.cpp | 615 ++ thirdparty/icu4c/source/common/uinvchar.h | 146 + thirdparty/icu4c/source/common/uiter.cpp | 1108 ++++ thirdparty/icu4c/source/common/ulist.cpp | 270 + thirdparty/icu4c/source/common/ulist.h | 50 + .../icu4c/source/common/ulistformatter.cpp | 91 + thirdparty/icu4c/source/common/uloc.cpp | 2672 ++++++++ .../icu4c/source/common/uloc_keytype.cpp | 592 ++ thirdparty/icu4c/source/common/uloc_tag.cpp | 2532 ++++++++ thirdparty/icu4c/source/common/ulocimp.h | 115 + thirdparty/icu4c/source/common/umapfile.cpp | 498 ++ thirdparty/icu4c/source/common/umapfile.h | 57 + thirdparty/icu4c/source/common/umath.cpp | 26 + thirdparty/icu4c/source/common/umutex.cpp | 378 ++ thirdparty/icu4c/source/common/umutex.h | 451 ++ thirdparty/icu4c/source/common/unames.cpp | 2101 ++++++ .../icu4c/source/common/unicode/appendable.h | 234 + .../icu4c/source/common/unicode/brkiter.h | 660 ++ .../icu4c/source/common/unicode/bytestream.h | 272 + .../icu4c/source/common/unicode/bytestrie.h | 520 ++ .../source/common/unicode/bytestriebuilder.h | 182 + .../icu4c/source/common/unicode/caniter.h | 210 + .../icu4c/source/common/unicode/casemap.h | 494 ++ .../icu4c/source/common/unicode/char16ptr.h | 302 + .../icu4c/source/common/unicode/chariter.h | 728 +++ thirdparty/icu4c/source/common/unicode/dbbi.h | 42 + .../icu4c/source/common/unicode/docmain.h | 222 + .../icu4c/source/common/unicode/dtintrv.h | 160 + .../icu4c/source/common/unicode/edits.h | 532 ++ .../icu4c/source/common/unicode/enumset.h | 66 + .../icu4c/source/common/unicode/errorcode.h | 139 + .../icu4c/source/common/unicode/filteredbrk.h | 149 + .../icu4c/source/common/unicode/icudataver.h | 43 + .../icu4c/source/common/unicode/icuplug.h | 388 ++ thirdparty/icu4c/source/common/unicode/idna.h | 325 + .../source/common/unicode/listformatter.h | 171 + .../source/common/unicode/localpointer.h | 524 ++ .../icu4c/source/common/unicode/locdspnm.h | 207 + .../icu4c/source/common/unicode/locid.h | 815 +++ .../source/common/unicode/messagepattern.h | 945 +++ .../icu4c/source/common/unicode/normalizer2.h | 774 +++ .../icu4c/source/common/unicode/normlzr.h | 809 +++ .../icu4c/source/common/unicode/parseerr.h | 94 + .../icu4c/source/common/unicode/parsepos.h | 232 + .../icu4c/source/common/unicode/platform.h | 851 +++ .../icu4c/source/common/unicode/ptypes.h | 128 + .../icu4c/source/common/unicode/putil.h | 183 + thirdparty/icu4c/source/common/unicode/rbbi.h | 699 ++ thirdparty/icu4c/source/common/unicode/rep.h | 263 + .../icu4c/source/common/unicode/resbund.h | 492 ++ .../icu4c/source/common/unicode/schriter.h | 189 + .../source/common/unicode/simpleformatter.h | 303 + .../icu4c/source/common/unicode/std_string.h | 37 + .../icu4c/source/common/unicode/strenum.h | 278 + .../source/common/unicode/stringoptions.h | 198 + .../icu4c/source/common/unicode/stringpiece.h | 224 + .../source/common/unicode/stringtriebuilder.h | 414 ++ .../icu4c/source/common/unicode/symtable.h | 114 + .../icu4c/source/common/unicode/ubidi.h | 2201 +++++++ .../source/common/unicode/ubiditransform.h | 318 + thirdparty/icu4c/source/common/unicode/ubrk.h | 628 ++ .../icu4c/source/common/unicode/ucasemap.h | 385 ++ thirdparty/icu4c/source/common/unicode/ucat.h | 160 + .../icu4c/source/common/unicode/uchar.h | 3770 +++++++++++ .../icu4c/source/common/unicode/ucharstrie.h | 578 ++ .../source/common/unicode/ucharstriebuilder.h | 187 + .../icu4c/source/common/unicode/uchriter.h | 387 ++ .../icu4c/source/common/unicode/uclean.h | 262 + thirdparty/icu4c/source/common/unicode/ucnv.h | 2043 ++++++ .../icu4c/source/common/unicode/ucnv_cb.h | 164 + .../icu4c/source/common/unicode/ucnv_err.h | 465 ++ .../icu4c/source/common/unicode/ucnvsel.h | 189 + .../icu4c/source/common/unicode/uconfig.h | 455 ++ .../icu4c/source/common/unicode/ucurr.h | 433 ++ .../icu4c/source/common/unicode/udata.h | 437 ++ .../source/common/unicode/udisplaycontext.h | 172 + .../icu4c/source/common/unicode/uenum.h | 210 + .../icu4c/source/common/unicode/uidna.h | 772 +++ .../icu4c/source/common/unicode/uiter.h | 709 ++ .../icu4c/source/common/unicode/uldnames.h | 304 + .../source/common/unicode/ulistformatter.h | 130 + thirdparty/icu4c/source/common/unicode/uloc.h | 1272 ++++ .../icu4c/source/common/unicode/umachine.h | 424 ++ .../icu4c/source/common/unicode/umisc.h | 62 + .../icu4c/source/common/unicode/unifilt.h | 122 + .../icu4c/source/common/unicode/unifunct.h | 127 + .../icu4c/source/common/unicode/unimatch.h | 165 + .../icu4c/source/common/unicode/uniset.h | 1716 +++++ .../icu4c/source/common/unicode/unistr.h | 4771 ++++++++++++++ .../icu4c/source/common/unicode/unorm.h | 472 ++ .../icu4c/source/common/unicode/unorm2.h | 603 ++ .../icu4c/source/common/unicode/uobject.h | 322 + .../icu4c/source/common/unicode/urename.h | 1832 ++++++ thirdparty/icu4c/source/common/unicode/urep.h | 157 + thirdparty/icu4c/source/common/unicode/ures.h | 908 +++ .../icu4c/source/common/unicode/uscript.h | 690 ++ thirdparty/icu4c/source/common/unicode/uset.h | 1130 ++++ .../icu4c/source/common/unicode/usetiter.h | 320 + .../icu4c/source/common/unicode/ushape.h | 476 ++ .../icu4c/source/common/unicode/usprep.h | 271 + .../icu4c/source/common/unicode/ustring.h | 1692 +++++ .../icu4c/source/common/unicode/ustringtrie.h | 97 + .../icu4c/source/common/unicode/utext.h | 1602 +++++ thirdparty/icu4c/source/common/unicode/utf.h | 225 + .../icu4c/source/common/unicode/utf16.h | 745 +++ .../icu4c/source/common/unicode/utf32.h | 25 + thirdparty/icu4c/source/common/unicode/utf8.h | 882 +++ .../icu4c/source/common/unicode/utf_old.h | 1204 ++++ .../icu4c/source/common/unicode/utrace.h | 379 ++ .../icu4c/source/common/unicode/utypes.h | 707 ++ .../icu4c/source/common/unicode/uvernum.h | 178 + .../icu4c/source/common/unicode/uversion.h | 201 + .../icu4c/source/common/unifiedcache.cpp | 519 ++ thirdparty/icu4c/source/common/unifiedcache.h | 556 ++ thirdparty/icu4c/source/common/unifilt.cpp | 71 + thirdparty/icu4c/source/common/unifunct.cpp | 28 + thirdparty/icu4c/source/common/uniset.cpp | 2362 +++++++ .../icu4c/source/common/uniset_closure.cpp | 280 + .../icu4c/source/common/uniset_props.cpp | 1319 ++++ thirdparty/icu4c/source/common/unisetspan.cpp | 1509 +++++ thirdparty/icu4c/source/common/unisetspan.h | 157 + thirdparty/icu4c/source/common/unistr.cpp | 1944 ++++++ .../icu4c/source/common/unistr_case.cpp | 250 + .../source/common/unistr_case_locale.cpp | 56 + thirdparty/icu4c/source/common/unistr_cnv.cpp | 417 ++ .../icu4c/source/common/unistr_props.cpp | 77 + .../common/unistr_titlecase_brkiter.cpp | 57 + .../icu4c/source/common/unistrappender.h | 90 + thirdparty/icu4c/source/common/unorm.cpp | 280 + thirdparty/icu4c/source/common/unormcmp.cpp | 640 ++ thirdparty/icu4c/source/common/unormimp.h | 488 ++ thirdparty/icu4c/source/common/uobject.cpp | 105 + thirdparty/icu4c/source/common/uposixdefs.h | 71 + thirdparty/icu4c/source/common/uprops.cpp | 617 ++ thirdparty/icu4c/source/common/uprops.h | 463 ++ thirdparty/icu4c/source/common/ures_cnv.cpp | 78 + thirdparty/icu4c/source/common/uresbund.cpp | 2994 +++++++++ thirdparty/icu4c/source/common/uresdata.cpp | 1482 +++++ thirdparty/icu4c/source/common/uresdata.h | 519 ++ thirdparty/icu4c/source/common/uresimp.h | 278 + thirdparty/icu4c/source/common/ureslocs.h | 27 + thirdparty/icu4c/source/common/usc_impl.cpp | 361 ++ thirdparty/icu4c/source/common/usc_impl.h | 139 + thirdparty/icu4c/source/common/uscript.cpp | 144 + .../icu4c/source/common/uscript_props.cpp | 294 + thirdparty/icu4c/source/common/uset.cpp | 641 ++ thirdparty/icu4c/source/common/uset_imp.h | 62 + thirdparty/icu4c/source/common/uset_props.cpp | 143 + thirdparty/icu4c/source/common/usetiter.cpp | 152 + thirdparty/icu4c/source/common/ushape.cpp | 1728 +++++ thirdparty/icu4c/source/common/usprep.cpp | 870 +++ thirdparty/icu4c/source/common/ustack.cpp | 63 + thirdparty/icu4c/source/common/ustr_cnv.cpp | 256 + thirdparty/icu4c/source/common/ustr_cnv.h | 51 + thirdparty/icu4c/source/common/ustr_imp.h | 143 + .../source/common/ustr_titlecase_brkiter.cpp | 245 + thirdparty/icu4c/source/common/ustr_wcs.cpp | 535 ++ thirdparty/icu4c/source/common/ustrcase.cpp | 1818 ++++++ .../icu4c/source/common/ustrcase_locale.cpp | 94 + thirdparty/icu4c/source/common/ustrenum.cpp | 398 ++ thirdparty/icu4c/source/common/ustrenum.h | 87 + thirdparty/icu4c/source/common/ustrfmt.cpp | 59 + thirdparty/icu4c/source/common/ustrfmt.h | 19 + thirdparty/icu4c/source/common/ustring.cpp | 1519 +++++ thirdparty/icu4c/source/common/ustrtrns.cpp | 1451 +++++ thirdparty/icu4c/source/common/utext.cpp | 2875 +++++++++ thirdparty/icu4c/source/common/utf_impl.cpp | 329 + thirdparty/icu4c/source/common/util.cpp | 411 ++ thirdparty/icu4c/source/common/util.h | 248 + thirdparty/icu4c/source/common/util_props.cpp | 217 + thirdparty/icu4c/source/common/utrace.cpp | 493 ++ thirdparty/icu4c/source/common/utracimp.h | 372 ++ thirdparty/icu4c/source/common/utrie.cpp | 1234 ++++ thirdparty/icu4c/source/common/utrie.h | 797 +++ thirdparty/icu4c/source/common/utrie2.cpp | 767 +++ thirdparty/icu4c/source/common/utrie2.h | 986 +++ .../icu4c/source/common/utrie2_builder.cpp | 1441 +++++ thirdparty/icu4c/source/common/utrie2_impl.h | 174 + thirdparty/icu4c/source/common/uts46.cpp | 1473 +++++ thirdparty/icu4c/source/common/utypeinfo.h | 32 + thirdparty/icu4c/source/common/utypes.cpp | 226 + thirdparty/icu4c/source/common/uvector.cpp | 567 ++ thirdparty/icu4c/source/common/uvector.h | 415 ++ thirdparty/icu4c/source/common/uvectr32.cpp | 335 + thirdparty/icu4c/source/common/uvectr32.h | 306 + thirdparty/icu4c/source/common/uvectr64.cpp | 214 + thirdparty/icu4c/source/common/uvectr64.h | 279 + thirdparty/icu4c/source/common/wintz.cpp | 396 ++ thirdparty/icu4c/source/common/wintz.h | 38 + .../icu4c/source/data/icudata_static.cpp | 31 + thirdparty/icu4c/source/data/icudata_stub.cpp | 65 + 627 files changed, 300712 insertions(+), 660 deletions(-) create mode 100644 doc/classes/ICUData.xml create mode 100644 doc/classes/ShapedAttributedString.xml create mode 100644 doc/classes/ShapedString.xml create mode 100755 drivers/harfbuzz/SCsub create mode 100644 drivers/harfbuzz/src/hb-bitmap.cc create mode 100644 drivers/harfbuzz/src/hb-bitmap.h create mode 100755 drivers/icu4c/SCsub create mode 100644 editor/icons/icon_i_c_u_data.svg create mode 100644 editor/icons/icon_label_legacy.svg create mode 100644 editor/icons/icon_legacy_control.svg create mode 100644 editor/icons/icon_line_edit_legacy.svg create mode 100644 editor/icons/icon_shaped_attributed_string.svg create mode 100644 editor/icons/icon_shaped_string.svg create mode 100644 main/tests/test_shaping.cpp create mode 100644 main/tests/test_shaping.h create mode 100644 scene/gui/legacy/SCsub create mode 100644 scene/gui/legacy/label_legacy.cpp create mode 100644 scene/gui/legacy/label_legacy.h create mode 100644 scene/gui/legacy/legacy.h create mode 100644 scene/gui/legacy/line_edit_legacy.cpp create mode 100644 scene/gui/legacy/line_edit_legacy.h create mode 100644 scene/resources/icu_data.cpp create mode 100644 scene/resources/icu_data.h create mode 100644 scene/resources/shaped_attributed_string.cpp create mode 100644 scene/resources/shaped_attributed_string.h create mode 100644 scene/resources/shaped_string.cpp create mode 100644 scene/resources/shaped_string.h create mode 100644 thirdparty/harfbuzz/AUTHORS create mode 100644 thirdparty/harfbuzz/COPYING create mode 100644 thirdparty/harfbuzz/NEWS create mode 100644 thirdparty/harfbuzz/README create mode 100644 thirdparty/harfbuzz/THANKS create mode 100644 thirdparty/harfbuzz/src/hb-aat-layout-ankr-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-aat-layout-bsln-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-aat-layout-common-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-aat-layout-feat-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-aat-layout-kerx-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-aat-layout-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-aat-layout-trak-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-aat-layout.cc create mode 100644 thirdparty/harfbuzz/src/hb-aat-ltag-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-atomic-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-blob-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-blob.cc create mode 100644 thirdparty/harfbuzz/src/hb-blob.h create mode 100644 thirdparty/harfbuzz/src/hb-buffer-deserialize-json.hh create mode 100644 thirdparty/harfbuzz/src/hb-buffer-deserialize-json.rl create mode 100644 thirdparty/harfbuzz/src/hb-buffer-deserialize-text.hh create mode 100644 thirdparty/harfbuzz/src/hb-buffer-deserialize-text.rl create mode 100644 thirdparty/harfbuzz/src/hb-buffer-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-buffer-serialize.cc create mode 100644 thirdparty/harfbuzz/src/hb-buffer.cc create mode 100644 thirdparty/harfbuzz/src/hb-buffer.h create mode 100644 thirdparty/harfbuzz/src/hb-common.cc create mode 100644 thirdparty/harfbuzz/src/hb-common.h create mode 100644 thirdparty/harfbuzz/src/hb-debug.hh create mode 100644 thirdparty/harfbuzz/src/hb-deprecated.h create mode 100644 thirdparty/harfbuzz/src/hb-dsalgs.hh create mode 100644 thirdparty/harfbuzz/src/hb-face-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-face.cc create mode 100644 thirdparty/harfbuzz/src/hb-face.h create mode 100644 thirdparty/harfbuzz/src/hb-fallback-shape.cc create mode 100644 thirdparty/harfbuzz/src/hb-font-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-font.cc create mode 100644 thirdparty/harfbuzz/src/hb-font.h create mode 100644 thirdparty/harfbuzz/src/hb-ft.cc create mode 100644 thirdparty/harfbuzz/src/hb-ft.h create mode 100644 thirdparty/harfbuzz/src/hb-graphite2.cc create mode 100644 thirdparty/harfbuzz/src/hb-graphite2.h create mode 100644 thirdparty/harfbuzz/src/hb-icu.cc create mode 100644 thirdparty/harfbuzz/src/hb-icu.h create mode 100644 thirdparty/harfbuzz/src/hb-iter-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-machinery-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-map-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-map.cc create mode 100644 thirdparty/harfbuzz/src/hb-map.h create mode 100644 thirdparty/harfbuzz/src/hb-mutex-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-null.hh create mode 100644 thirdparty/harfbuzz/src/hb-object-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-open-file-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-open-type-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-cbdt-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-cmap-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-color-cbdt-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-color-colr-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-color-cpal-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-color-sbix-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-color-svg-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-color.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-font.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-font.h create mode 100644 thirdparty/harfbuzz/src/hb-ot-glyf-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-hdmx-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-head-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-hhea-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-kern-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-layout-base-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-layout-common-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-layout-gdef-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-layout-gpos-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-layout-gsub-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-layout-jstf-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-layout-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-layout.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-layout.h create mode 100644 thirdparty/harfbuzz/src/hb-ot-map-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-map.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-math-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-math.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-math.h create mode 100644 thirdparty/harfbuzz/src/hb-ot-maxp-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-name-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-os2-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-os2-unicode-ranges.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-post-macroman.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-post-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic-fallback.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic-win1256.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-default.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-hangul.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-hebrew.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-machine.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-machine.rl create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-table.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-indic.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer-machine.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer-machine.rl create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar-machine.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar-machine.rl create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-thai.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-tibetan.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-use-machine.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-use-machine.rl create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-use-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-use-table.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-complex-use.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-fallback-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-fallback.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-normalize-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-normalize.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-shape.h create mode 100644 thirdparty/harfbuzz/src/hb-ot-tag.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-tag.h create mode 100644 thirdparty/harfbuzz/src/hb-ot-var-avar-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-var-fvar-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-var-hvar-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-var-mvar-table.hh create mode 100644 thirdparty/harfbuzz/src/hb-ot-var.cc create mode 100644 thirdparty/harfbuzz/src/hb-ot-var.h create mode 100644 thirdparty/harfbuzz/src/hb-ot.h create mode 100644 thirdparty/harfbuzz/src/hb-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-set-digest-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-set-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-set.cc create mode 100644 thirdparty/harfbuzz/src/hb-set.h create mode 100644 thirdparty/harfbuzz/src/hb-shape-plan-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-shape-plan.cc create mode 100644 thirdparty/harfbuzz/src/hb-shape-plan.h create mode 100644 thirdparty/harfbuzz/src/hb-shape.cc create mode 100644 thirdparty/harfbuzz/src/hb-shape.h create mode 100644 thirdparty/harfbuzz/src/hb-shaper-impl-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-shaper-list.hh create mode 100644 thirdparty/harfbuzz/src/hb-shaper-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-shaper.cc create mode 100644 thirdparty/harfbuzz/src/hb-static.cc create mode 100644 thirdparty/harfbuzz/src/hb-string-array.hh create mode 100644 thirdparty/harfbuzz/src/hb-subset-glyf.cc create mode 100644 thirdparty/harfbuzz/src/hb-subset-glyf.hh create mode 100644 thirdparty/harfbuzz/src/hb-subset-input.cc create mode 100644 thirdparty/harfbuzz/src/hb-subset-plan.cc create mode 100644 thirdparty/harfbuzz/src/hb-subset-plan.hh create mode 100644 thirdparty/harfbuzz/src/hb-subset-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-subset.cc create mode 100644 thirdparty/harfbuzz/src/hb-subset.h create mode 100644 thirdparty/harfbuzz/src/hb-unicode-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-unicode.cc create mode 100644 thirdparty/harfbuzz/src/hb-unicode.h create mode 100644 thirdparty/harfbuzz/src/hb-utf-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-vector-private.hh create mode 100644 thirdparty/harfbuzz/src/hb-version.h create mode 100644 thirdparty/harfbuzz/src/hb-warning.cc create mode 100644 thirdparty/harfbuzz/src/hb.h create mode 100644 thirdparty/icu4c/APIChangeReport.html create mode 100644 thirdparty/icu4c/LICENSE create mode 100644 thirdparty/icu4c/icu4c.css create mode 100644 thirdparty/icu4c/license.html create mode 100644 thirdparty/icu4c/readme.html create mode 100644 thirdparty/icu4c/source/common/appendable.cpp create mode 100644 thirdparty/icu4c/source/common/bmpset.cpp create mode 100644 thirdparty/icu4c/source/common/bmpset.h create mode 100644 thirdparty/icu4c/source/common/brkeng.cpp create mode 100644 thirdparty/icu4c/source/common/brkeng.h create mode 100644 thirdparty/icu4c/source/common/brkiter.cpp create mode 100644 thirdparty/icu4c/source/common/bytesinkutil.cpp create mode 100644 thirdparty/icu4c/source/common/bytesinkutil.h create mode 100644 thirdparty/icu4c/source/common/bytestream.cpp create mode 100644 thirdparty/icu4c/source/common/bytestrie.cpp create mode 100644 thirdparty/icu4c/source/common/bytestriebuilder.cpp create mode 100644 thirdparty/icu4c/source/common/bytestrieiterator.cpp create mode 100644 thirdparty/icu4c/source/common/caniter.cpp create mode 100644 thirdparty/icu4c/source/common/chariter.cpp create mode 100644 thirdparty/icu4c/source/common/charstr.cpp create mode 100644 thirdparty/icu4c/source/common/charstr.h create mode 100644 thirdparty/icu4c/source/common/cmemory.cpp create mode 100644 thirdparty/icu4c/source/common/cmemory.h create mode 100644 thirdparty/icu4c/source/common/common.rc create mode 100644 thirdparty/icu4c/source/common/cpputils.h create mode 100644 thirdparty/icu4c/source/common/cstr.cpp create mode 100644 thirdparty/icu4c/source/common/cstr.h create mode 100644 thirdparty/icu4c/source/common/cstring.cpp create mode 100644 thirdparty/icu4c/source/common/cstring.h create mode 100644 thirdparty/icu4c/source/common/cwchar.cpp create mode 100644 thirdparty/icu4c/source/common/cwchar.h create mode 100644 thirdparty/icu4c/source/common/dictbe.cpp create mode 100644 thirdparty/icu4c/source/common/dictbe.h create mode 100644 thirdparty/icu4c/source/common/dictionarydata.cpp create mode 100644 thirdparty/icu4c/source/common/dictionarydata.h create mode 100644 thirdparty/icu4c/source/common/dtintrv.cpp create mode 100644 thirdparty/icu4c/source/common/edits.cpp create mode 100644 thirdparty/icu4c/source/common/errorcode.cpp create mode 100644 thirdparty/icu4c/source/common/filteredbrk.cpp create mode 100644 thirdparty/icu4c/source/common/filterednormalizer2.cpp create mode 100644 thirdparty/icu4c/source/common/hash.h create mode 100644 thirdparty/icu4c/source/common/icudataver.cpp create mode 100644 thirdparty/icu4c/source/common/icuplug.cpp create mode 100644 thirdparty/icu4c/source/common/icuplugimp.h create mode 100644 thirdparty/icu4c/source/common/listformatter.cpp create mode 100644 thirdparty/icu4c/source/common/loadednormalizer2impl.cpp create mode 100644 thirdparty/icu4c/source/common/localsvc.h create mode 100644 thirdparty/icu4c/source/common/locavailable.cpp create mode 100644 thirdparty/icu4c/source/common/locbased.cpp create mode 100644 thirdparty/icu4c/source/common/locbased.h create mode 100644 thirdparty/icu4c/source/common/locdispnames.cpp create mode 100644 thirdparty/icu4c/source/common/locdspnm.cpp create mode 100644 thirdparty/icu4c/source/common/locid.cpp create mode 100644 thirdparty/icu4c/source/common/loclikely.cpp create mode 100644 thirdparty/icu4c/source/common/locmap.cpp create mode 100644 thirdparty/icu4c/source/common/locmap.h create mode 100644 thirdparty/icu4c/source/common/locresdata.cpp create mode 100644 thirdparty/icu4c/source/common/locutil.cpp create mode 100644 thirdparty/icu4c/source/common/locutil.h create mode 100644 thirdparty/icu4c/source/common/messageimpl.h create mode 100644 thirdparty/icu4c/source/common/messagepattern.cpp create mode 100644 thirdparty/icu4c/source/common/msvcres.h create mode 100644 thirdparty/icu4c/source/common/mutex.h create mode 100644 thirdparty/icu4c/source/common/norm2_nfc_data.h create mode 100644 thirdparty/icu4c/source/common/norm2allmodes.h create mode 100644 thirdparty/icu4c/source/common/normalizer2.cpp create mode 100644 thirdparty/icu4c/source/common/normalizer2impl.cpp create mode 100644 thirdparty/icu4c/source/common/normalizer2impl.h create mode 100644 thirdparty/icu4c/source/common/normlzr.cpp create mode 100644 thirdparty/icu4c/source/common/parsepos.cpp create mode 100644 thirdparty/icu4c/source/common/patternprops.cpp create mode 100644 thirdparty/icu4c/source/common/patternprops.h create mode 100644 thirdparty/icu4c/source/common/pluralmap.cpp create mode 100644 thirdparty/icu4c/source/common/pluralmap.h create mode 100644 thirdparty/icu4c/source/common/propname.cpp create mode 100644 thirdparty/icu4c/source/common/propname.h create mode 100644 thirdparty/icu4c/source/common/propname_data.h create mode 100644 thirdparty/icu4c/source/common/propsvec.cpp create mode 100644 thirdparty/icu4c/source/common/propsvec.h create mode 100644 thirdparty/icu4c/source/common/punycode.cpp create mode 100644 thirdparty/icu4c/source/common/punycode.h create mode 100644 thirdparty/icu4c/source/common/putil.cpp create mode 100644 thirdparty/icu4c/source/common/putilimp.h create mode 100644 thirdparty/icu4c/source/common/rbbi.cpp create mode 100644 thirdparty/icu4c/source/common/rbbi_cache.cpp create mode 100644 thirdparty/icu4c/source/common/rbbi_cache.h create mode 100755 thirdparty/icu4c/source/common/rbbicst.pl create mode 100644 thirdparty/icu4c/source/common/rbbidata.cpp create mode 100644 thirdparty/icu4c/source/common/rbbidata.h create mode 100644 thirdparty/icu4c/source/common/rbbinode.cpp create mode 100644 thirdparty/icu4c/source/common/rbbinode.h create mode 100644 thirdparty/icu4c/source/common/rbbirb.cpp create mode 100644 thirdparty/icu4c/source/common/rbbirb.h create mode 100644 thirdparty/icu4c/source/common/rbbirpt.h create mode 100644 thirdparty/icu4c/source/common/rbbirpt.txt create mode 100644 thirdparty/icu4c/source/common/rbbiscan.cpp create mode 100644 thirdparty/icu4c/source/common/rbbiscan.h create mode 100644 thirdparty/icu4c/source/common/rbbisetb.cpp create mode 100644 thirdparty/icu4c/source/common/rbbisetb.h create mode 100644 thirdparty/icu4c/source/common/rbbistbl.cpp create mode 100644 thirdparty/icu4c/source/common/rbbitblb.cpp create mode 100644 thirdparty/icu4c/source/common/rbbitblb.h create mode 100644 thirdparty/icu4c/source/common/resbund.cpp create mode 100644 thirdparty/icu4c/source/common/resbund_cnv.cpp create mode 100644 thirdparty/icu4c/source/common/resource.cpp create mode 100644 thirdparty/icu4c/source/common/resource.h create mode 100644 thirdparty/icu4c/source/common/ruleiter.cpp create mode 100644 thirdparty/icu4c/source/common/ruleiter.h create mode 100644 thirdparty/icu4c/source/common/schriter.cpp create mode 100644 thirdparty/icu4c/source/common/serv.cpp create mode 100644 thirdparty/icu4c/source/common/serv.h create mode 100644 thirdparty/icu4c/source/common/servlk.cpp create mode 100644 thirdparty/icu4c/source/common/servlkf.cpp create mode 100644 thirdparty/icu4c/source/common/servloc.h create mode 100644 thirdparty/icu4c/source/common/servls.cpp create mode 100644 thirdparty/icu4c/source/common/servnotf.cpp create mode 100644 thirdparty/icu4c/source/common/servnotf.h create mode 100644 thirdparty/icu4c/source/common/servrbf.cpp create mode 100644 thirdparty/icu4c/source/common/servslkf.cpp create mode 100644 thirdparty/icu4c/source/common/sharedobject.cpp create mode 100644 thirdparty/icu4c/source/common/sharedobject.h create mode 100644 thirdparty/icu4c/source/common/simpleformatter.cpp create mode 100644 thirdparty/icu4c/source/common/sprpimpl.h create mode 100644 thirdparty/icu4c/source/common/static_unicode_sets.cpp create mode 100644 thirdparty/icu4c/source/common/static_unicode_sets.h create mode 100644 thirdparty/icu4c/source/common/stringpiece.cpp create mode 100644 thirdparty/icu4c/source/common/stringtriebuilder.cpp create mode 100644 thirdparty/icu4c/source/common/uarrsort.cpp create mode 100644 thirdparty/icu4c/source/common/uarrsort.h create mode 100644 thirdparty/icu4c/source/common/uassert.h create mode 100644 thirdparty/icu4c/source/common/ubidi.cpp create mode 100644 thirdparty/icu4c/source/common/ubidi_props.cpp create mode 100644 thirdparty/icu4c/source/common/ubidi_props.h create mode 100644 thirdparty/icu4c/source/common/ubidi_props_data.h create mode 100644 thirdparty/icu4c/source/common/ubidiimp.h create mode 100644 thirdparty/icu4c/source/common/ubidiln.cpp create mode 100644 thirdparty/icu4c/source/common/ubiditransform.cpp create mode 100644 thirdparty/icu4c/source/common/ubidiwrt.cpp create mode 100644 thirdparty/icu4c/source/common/ubrk.cpp create mode 100644 thirdparty/icu4c/source/common/ubrkimpl.h create mode 100644 thirdparty/icu4c/source/common/ucase.cpp create mode 100644 thirdparty/icu4c/source/common/ucase.h create mode 100644 thirdparty/icu4c/source/common/ucase_props_data.h create mode 100644 thirdparty/icu4c/source/common/ucasemap.cpp create mode 100644 thirdparty/icu4c/source/common/ucasemap_imp.h create mode 100644 thirdparty/icu4c/source/common/ucasemap_titlecase_brkiter.cpp create mode 100644 thirdparty/icu4c/source/common/ucat.cpp create mode 100644 thirdparty/icu4c/source/common/uchar.cpp create mode 100644 thirdparty/icu4c/source/common/uchar_props_data.h create mode 100644 thirdparty/icu4c/source/common/ucharstrie.cpp create mode 100644 thirdparty/icu4c/source/common/ucharstriebuilder.cpp create mode 100644 thirdparty/icu4c/source/common/ucharstrieiterator.cpp create mode 100644 thirdparty/icu4c/source/common/uchriter.cpp create mode 100644 thirdparty/icu4c/source/common/ucln.h create mode 100644 thirdparty/icu4c/source/common/ucln_cmn.cpp create mode 100644 thirdparty/icu4c/source/common/ucln_cmn.h create mode 100644 thirdparty/icu4c/source/common/ucln_imp.h create mode 100644 thirdparty/icu4c/source/common/ucmndata.cpp create mode 100644 thirdparty/icu4c/source/common/ucmndata.h create mode 100644 thirdparty/icu4c/source/common/ucnv.cpp create mode 100644 thirdparty/icu4c/source/common/ucnv2022.cpp create mode 100644 thirdparty/icu4c/source/common/ucnv_bld.cpp create mode 100644 thirdparty/icu4c/source/common/ucnv_bld.h create mode 100644 thirdparty/icu4c/source/common/ucnv_cb.cpp create mode 100644 thirdparty/icu4c/source/common/ucnv_cnv.cpp create mode 100644 thirdparty/icu4c/source/common/ucnv_cnv.h create mode 100644 thirdparty/icu4c/source/common/ucnv_ct.cpp create mode 100644 thirdparty/icu4c/source/common/ucnv_err.cpp create mode 100644 thirdparty/icu4c/source/common/ucnv_ext.cpp create mode 100644 thirdparty/icu4c/source/common/ucnv_ext.h create mode 100644 thirdparty/icu4c/source/common/ucnv_imp.h create mode 100644 thirdparty/icu4c/source/common/ucnv_io.cpp create mode 100644 thirdparty/icu4c/source/common/ucnv_io.h create mode 100644 thirdparty/icu4c/source/common/ucnv_lmb.cpp create mode 100644 thirdparty/icu4c/source/common/ucnv_set.cpp create mode 100644 thirdparty/icu4c/source/common/ucnv_u16.cpp create mode 100644 thirdparty/icu4c/source/common/ucnv_u32.cpp create mode 100644 thirdparty/icu4c/source/common/ucnv_u7.cpp create mode 100644 thirdparty/icu4c/source/common/ucnv_u8.cpp create mode 100644 thirdparty/icu4c/source/common/ucnvbocu.cpp create mode 100644 thirdparty/icu4c/source/common/ucnvdisp.cpp create mode 100644 thirdparty/icu4c/source/common/ucnvhz.cpp create mode 100644 thirdparty/icu4c/source/common/ucnvisci.cpp create mode 100644 thirdparty/icu4c/source/common/ucnvlat1.cpp create mode 100644 thirdparty/icu4c/source/common/ucnvmbcs.cpp create mode 100644 thirdparty/icu4c/source/common/ucnvmbcs.h create mode 100644 thirdparty/icu4c/source/common/ucnvscsu.cpp create mode 100644 thirdparty/icu4c/source/common/ucnvsel.cpp create mode 100644 thirdparty/icu4c/source/common/ucol_data.h create mode 100644 thirdparty/icu4c/source/common/ucol_swp.cpp create mode 100644 thirdparty/icu4c/source/common/ucol_swp.h create mode 100644 thirdparty/icu4c/source/common/ucurr.cpp create mode 100644 thirdparty/icu4c/source/common/ucurrimp.h create mode 100644 thirdparty/icu4c/source/common/udata.cpp create mode 100644 thirdparty/icu4c/source/common/udatamem.cpp create mode 100644 thirdparty/icu4c/source/common/udatamem.h create mode 100644 thirdparty/icu4c/source/common/udataswp.cpp create mode 100644 thirdparty/icu4c/source/common/udataswp.h create mode 100644 thirdparty/icu4c/source/common/uelement.h create mode 100644 thirdparty/icu4c/source/common/uenum.cpp create mode 100644 thirdparty/icu4c/source/common/uenumimp.h create mode 100644 thirdparty/icu4c/source/common/uhash.cpp create mode 100644 thirdparty/icu4c/source/common/uhash.h create mode 100644 thirdparty/icu4c/source/common/uhash_us.cpp create mode 100644 thirdparty/icu4c/source/common/uidna.cpp create mode 100644 thirdparty/icu4c/source/common/uinit.cpp create mode 100644 thirdparty/icu4c/source/common/uinvchar.cpp create mode 100644 thirdparty/icu4c/source/common/uinvchar.h create mode 100644 thirdparty/icu4c/source/common/uiter.cpp create mode 100644 thirdparty/icu4c/source/common/ulist.cpp create mode 100644 thirdparty/icu4c/source/common/ulist.h create mode 100644 thirdparty/icu4c/source/common/ulistformatter.cpp create mode 100644 thirdparty/icu4c/source/common/uloc.cpp create mode 100644 thirdparty/icu4c/source/common/uloc_keytype.cpp create mode 100644 thirdparty/icu4c/source/common/uloc_tag.cpp create mode 100644 thirdparty/icu4c/source/common/ulocimp.h create mode 100644 thirdparty/icu4c/source/common/umapfile.cpp create mode 100644 thirdparty/icu4c/source/common/umapfile.h create mode 100644 thirdparty/icu4c/source/common/umath.cpp create mode 100644 thirdparty/icu4c/source/common/umutex.cpp create mode 100644 thirdparty/icu4c/source/common/umutex.h create mode 100644 thirdparty/icu4c/source/common/unames.cpp create mode 100644 thirdparty/icu4c/source/common/unicode/appendable.h create mode 100644 thirdparty/icu4c/source/common/unicode/brkiter.h create mode 100644 thirdparty/icu4c/source/common/unicode/bytestream.h create mode 100644 thirdparty/icu4c/source/common/unicode/bytestrie.h create mode 100644 thirdparty/icu4c/source/common/unicode/bytestriebuilder.h create mode 100644 thirdparty/icu4c/source/common/unicode/caniter.h create mode 100644 thirdparty/icu4c/source/common/unicode/casemap.h create mode 100644 thirdparty/icu4c/source/common/unicode/char16ptr.h create mode 100644 thirdparty/icu4c/source/common/unicode/chariter.h create mode 100644 thirdparty/icu4c/source/common/unicode/dbbi.h create mode 100644 thirdparty/icu4c/source/common/unicode/docmain.h create mode 100644 thirdparty/icu4c/source/common/unicode/dtintrv.h create mode 100644 thirdparty/icu4c/source/common/unicode/edits.h create mode 100644 thirdparty/icu4c/source/common/unicode/enumset.h create mode 100644 thirdparty/icu4c/source/common/unicode/errorcode.h create mode 100644 thirdparty/icu4c/source/common/unicode/filteredbrk.h create mode 100644 thirdparty/icu4c/source/common/unicode/icudataver.h create mode 100644 thirdparty/icu4c/source/common/unicode/icuplug.h create mode 100644 thirdparty/icu4c/source/common/unicode/idna.h create mode 100644 thirdparty/icu4c/source/common/unicode/listformatter.h create mode 100644 thirdparty/icu4c/source/common/unicode/localpointer.h create mode 100644 thirdparty/icu4c/source/common/unicode/locdspnm.h create mode 100644 thirdparty/icu4c/source/common/unicode/locid.h create mode 100644 thirdparty/icu4c/source/common/unicode/messagepattern.h create mode 100644 thirdparty/icu4c/source/common/unicode/normalizer2.h create mode 100644 thirdparty/icu4c/source/common/unicode/normlzr.h create mode 100644 thirdparty/icu4c/source/common/unicode/parseerr.h create mode 100644 thirdparty/icu4c/source/common/unicode/parsepos.h create mode 100644 thirdparty/icu4c/source/common/unicode/platform.h create mode 100644 thirdparty/icu4c/source/common/unicode/ptypes.h create mode 100644 thirdparty/icu4c/source/common/unicode/putil.h create mode 100644 thirdparty/icu4c/source/common/unicode/rbbi.h create mode 100644 thirdparty/icu4c/source/common/unicode/rep.h create mode 100644 thirdparty/icu4c/source/common/unicode/resbund.h create mode 100644 thirdparty/icu4c/source/common/unicode/schriter.h create mode 100644 thirdparty/icu4c/source/common/unicode/simpleformatter.h create mode 100644 thirdparty/icu4c/source/common/unicode/std_string.h create mode 100644 thirdparty/icu4c/source/common/unicode/strenum.h create mode 100644 thirdparty/icu4c/source/common/unicode/stringoptions.h create mode 100644 thirdparty/icu4c/source/common/unicode/stringpiece.h create mode 100644 thirdparty/icu4c/source/common/unicode/stringtriebuilder.h create mode 100644 thirdparty/icu4c/source/common/unicode/symtable.h create mode 100644 thirdparty/icu4c/source/common/unicode/ubidi.h create mode 100644 thirdparty/icu4c/source/common/unicode/ubiditransform.h create mode 100644 thirdparty/icu4c/source/common/unicode/ubrk.h create mode 100644 thirdparty/icu4c/source/common/unicode/ucasemap.h create mode 100644 thirdparty/icu4c/source/common/unicode/ucat.h create mode 100644 thirdparty/icu4c/source/common/unicode/uchar.h create mode 100644 thirdparty/icu4c/source/common/unicode/ucharstrie.h create mode 100644 thirdparty/icu4c/source/common/unicode/ucharstriebuilder.h create mode 100644 thirdparty/icu4c/source/common/unicode/uchriter.h create mode 100644 thirdparty/icu4c/source/common/unicode/uclean.h create mode 100644 thirdparty/icu4c/source/common/unicode/ucnv.h create mode 100644 thirdparty/icu4c/source/common/unicode/ucnv_cb.h create mode 100644 thirdparty/icu4c/source/common/unicode/ucnv_err.h create mode 100644 thirdparty/icu4c/source/common/unicode/ucnvsel.h create mode 100644 thirdparty/icu4c/source/common/unicode/uconfig.h create mode 100644 thirdparty/icu4c/source/common/unicode/ucurr.h create mode 100644 thirdparty/icu4c/source/common/unicode/udata.h create mode 100644 thirdparty/icu4c/source/common/unicode/udisplaycontext.h create mode 100644 thirdparty/icu4c/source/common/unicode/uenum.h create mode 100644 thirdparty/icu4c/source/common/unicode/uidna.h create mode 100644 thirdparty/icu4c/source/common/unicode/uiter.h create mode 100644 thirdparty/icu4c/source/common/unicode/uldnames.h create mode 100644 thirdparty/icu4c/source/common/unicode/ulistformatter.h create mode 100644 thirdparty/icu4c/source/common/unicode/uloc.h create mode 100644 thirdparty/icu4c/source/common/unicode/umachine.h create mode 100644 thirdparty/icu4c/source/common/unicode/umisc.h create mode 100644 thirdparty/icu4c/source/common/unicode/unifilt.h create mode 100644 thirdparty/icu4c/source/common/unicode/unifunct.h create mode 100644 thirdparty/icu4c/source/common/unicode/unimatch.h create mode 100644 thirdparty/icu4c/source/common/unicode/uniset.h create mode 100644 thirdparty/icu4c/source/common/unicode/unistr.h create mode 100644 thirdparty/icu4c/source/common/unicode/unorm.h create mode 100644 thirdparty/icu4c/source/common/unicode/unorm2.h create mode 100644 thirdparty/icu4c/source/common/unicode/uobject.h create mode 100644 thirdparty/icu4c/source/common/unicode/urename.h create mode 100644 thirdparty/icu4c/source/common/unicode/urep.h create mode 100644 thirdparty/icu4c/source/common/unicode/ures.h create mode 100644 thirdparty/icu4c/source/common/unicode/uscript.h create mode 100644 thirdparty/icu4c/source/common/unicode/uset.h create mode 100644 thirdparty/icu4c/source/common/unicode/usetiter.h create mode 100644 thirdparty/icu4c/source/common/unicode/ushape.h create mode 100644 thirdparty/icu4c/source/common/unicode/usprep.h create mode 100644 thirdparty/icu4c/source/common/unicode/ustring.h create mode 100644 thirdparty/icu4c/source/common/unicode/ustringtrie.h create mode 100644 thirdparty/icu4c/source/common/unicode/utext.h create mode 100644 thirdparty/icu4c/source/common/unicode/utf.h create mode 100644 thirdparty/icu4c/source/common/unicode/utf16.h create mode 100644 thirdparty/icu4c/source/common/unicode/utf32.h create mode 100644 thirdparty/icu4c/source/common/unicode/utf8.h create mode 100644 thirdparty/icu4c/source/common/unicode/utf_old.h create mode 100644 thirdparty/icu4c/source/common/unicode/utrace.h create mode 100644 thirdparty/icu4c/source/common/unicode/utypes.h create mode 100644 thirdparty/icu4c/source/common/unicode/uvernum.h create mode 100644 thirdparty/icu4c/source/common/unicode/uversion.h create mode 100644 thirdparty/icu4c/source/common/unifiedcache.cpp create mode 100644 thirdparty/icu4c/source/common/unifiedcache.h create mode 100644 thirdparty/icu4c/source/common/unifilt.cpp create mode 100644 thirdparty/icu4c/source/common/unifunct.cpp create mode 100644 thirdparty/icu4c/source/common/uniset.cpp create mode 100644 thirdparty/icu4c/source/common/uniset_closure.cpp create mode 100644 thirdparty/icu4c/source/common/uniset_props.cpp create mode 100644 thirdparty/icu4c/source/common/unisetspan.cpp create mode 100644 thirdparty/icu4c/source/common/unisetspan.h create mode 100644 thirdparty/icu4c/source/common/unistr.cpp create mode 100644 thirdparty/icu4c/source/common/unistr_case.cpp create mode 100644 thirdparty/icu4c/source/common/unistr_case_locale.cpp create mode 100644 thirdparty/icu4c/source/common/unistr_cnv.cpp create mode 100644 thirdparty/icu4c/source/common/unistr_props.cpp create mode 100644 thirdparty/icu4c/source/common/unistr_titlecase_brkiter.cpp create mode 100644 thirdparty/icu4c/source/common/unistrappender.h create mode 100644 thirdparty/icu4c/source/common/unorm.cpp create mode 100644 thirdparty/icu4c/source/common/unormcmp.cpp create mode 100644 thirdparty/icu4c/source/common/unormimp.h create mode 100644 thirdparty/icu4c/source/common/uobject.cpp create mode 100644 thirdparty/icu4c/source/common/uposixdefs.h create mode 100644 thirdparty/icu4c/source/common/uprops.cpp create mode 100644 thirdparty/icu4c/source/common/uprops.h create mode 100644 thirdparty/icu4c/source/common/ures_cnv.cpp create mode 100644 thirdparty/icu4c/source/common/uresbund.cpp create mode 100644 thirdparty/icu4c/source/common/uresdata.cpp create mode 100644 thirdparty/icu4c/source/common/uresdata.h create mode 100644 thirdparty/icu4c/source/common/uresimp.h create mode 100644 thirdparty/icu4c/source/common/ureslocs.h create mode 100644 thirdparty/icu4c/source/common/usc_impl.cpp create mode 100644 thirdparty/icu4c/source/common/usc_impl.h create mode 100644 thirdparty/icu4c/source/common/uscript.cpp create mode 100644 thirdparty/icu4c/source/common/uscript_props.cpp create mode 100644 thirdparty/icu4c/source/common/uset.cpp create mode 100644 thirdparty/icu4c/source/common/uset_imp.h create mode 100644 thirdparty/icu4c/source/common/uset_props.cpp create mode 100644 thirdparty/icu4c/source/common/usetiter.cpp create mode 100644 thirdparty/icu4c/source/common/ushape.cpp create mode 100644 thirdparty/icu4c/source/common/usprep.cpp create mode 100644 thirdparty/icu4c/source/common/ustack.cpp create mode 100644 thirdparty/icu4c/source/common/ustr_cnv.cpp create mode 100644 thirdparty/icu4c/source/common/ustr_cnv.h create mode 100644 thirdparty/icu4c/source/common/ustr_imp.h create mode 100644 thirdparty/icu4c/source/common/ustr_titlecase_brkiter.cpp create mode 100644 thirdparty/icu4c/source/common/ustr_wcs.cpp create mode 100644 thirdparty/icu4c/source/common/ustrcase.cpp create mode 100644 thirdparty/icu4c/source/common/ustrcase_locale.cpp create mode 100644 thirdparty/icu4c/source/common/ustrenum.cpp create mode 100644 thirdparty/icu4c/source/common/ustrenum.h create mode 100644 thirdparty/icu4c/source/common/ustrfmt.cpp create mode 100644 thirdparty/icu4c/source/common/ustrfmt.h create mode 100644 thirdparty/icu4c/source/common/ustring.cpp create mode 100644 thirdparty/icu4c/source/common/ustrtrns.cpp create mode 100644 thirdparty/icu4c/source/common/utext.cpp create mode 100644 thirdparty/icu4c/source/common/utf_impl.cpp create mode 100644 thirdparty/icu4c/source/common/util.cpp create mode 100644 thirdparty/icu4c/source/common/util.h create mode 100644 thirdparty/icu4c/source/common/util_props.cpp create mode 100644 thirdparty/icu4c/source/common/utrace.cpp create mode 100644 thirdparty/icu4c/source/common/utracimp.h create mode 100644 thirdparty/icu4c/source/common/utrie.cpp create mode 100644 thirdparty/icu4c/source/common/utrie.h create mode 100644 thirdparty/icu4c/source/common/utrie2.cpp create mode 100644 thirdparty/icu4c/source/common/utrie2.h create mode 100644 thirdparty/icu4c/source/common/utrie2_builder.cpp create mode 100644 thirdparty/icu4c/source/common/utrie2_impl.h create mode 100644 thirdparty/icu4c/source/common/uts46.cpp create mode 100644 thirdparty/icu4c/source/common/utypeinfo.h create mode 100644 thirdparty/icu4c/source/common/utypes.cpp create mode 100644 thirdparty/icu4c/source/common/uvector.cpp create mode 100644 thirdparty/icu4c/source/common/uvector.h create mode 100644 thirdparty/icu4c/source/common/uvectr32.cpp create mode 100644 thirdparty/icu4c/source/common/uvectr32.h create mode 100644 thirdparty/icu4c/source/common/uvectr64.cpp create mode 100644 thirdparty/icu4c/source/common/uvectr64.h create mode 100644 thirdparty/icu4c/source/common/wintz.cpp create mode 100644 thirdparty/icu4c/source/common/wintz.h create mode 100644 thirdparty/icu4c/source/data/icudata_static.cpp create mode 100644 thirdparty/icu4c/source/data/icudata_stub.cpp diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index 8b263a2d2c0a..fe1f3601ad61 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -168,6 +168,26 @@ Comment: glad Copyright: 2013-2018, David Herberth License: Expat +Files: ./thirdparty/harfbuzz/ +Comment: HarfBuzz +Copyright: 2010, 2011, 2012, Google, Inc. + 2012, Mozilla Foundation + 2011, Codethink Limited + 2008, 2010, Nokia Corporation and/or its subsidiary(-ies) + 2009, Keith Stribley + 2009, Martin Hosken and SIL International + 2007, Chris Wilson + 2006, Behdad Esfahbod + 2005, David Turner + 2004, 2007, 2008, 2009, 2010, Red Hat, Inc. + 1998-2004, David Turner and Werner Lemberg +License: MIT-HarfBuzz + +Files: ./thirdparty/icu4c/ +Comment: International Components for Unicode +Copyright: 1991-2018 Unicode, Inc. +License: Unicode + Files: ./thirdparty/jpeg_compressor/ Comment: jpeg-compressor Copyright: 2012, Rich Geldreich @@ -1630,6 +1650,44 @@ License: LGPL-2.1+SLE (libwebsockets) . That's all there is to it! +License: MIT-HarfBuzz + HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. + For parts of HarfBuzz that are licensed under different licenses see individual + files names COPYING in subdirectories where applicable. + . + Copyright (c) 2010,2011,2012 Google, Inc. + Copyright (c) 2012 Mozilla Foundation + Copyright (c) 2011 Codethink Limited + Copyright (c) 2008,2010 Nokia Corporation and/or its subsidiary(-ies) + Copyright (c) 2009 Keith Stribley + Copyright (c) 2009 Martin Hosken and SIL International + Copyright (c) 2007 Chris Wilson + Copyright (c) 2006 Behdad Esfahbod + Copyright (c) 2005 David Turner + Copyright (c) 2004,2007,2008,2009,2010 Red Hat, Inc. + Copyright (c) 1998-2004 David Turner and Werner Lemberg + . + For full copyright notices consult the individual files in the package. + . + . + Permission is hereby granted, without written agreement and without + license or royalty fees, to use, copy, modify, and distribute this + software and its documentation for any purpose, provided that the + above copyright notice and the following two paragraphs appear in + all copies of this software. + . + IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + DAMAGE. + . + THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + License: MPL-2.0 Mozilla Public License Version 2.0 ================================== @@ -2106,6 +2164,41 @@ License: RSA-MD These notices must be retained in any copies of any part of this documentation and/or software. +License: Unicode + COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later) + . + Copyright (C) 1991-2017 Unicode, Inc. All rights reserved. + Distributed under the Terms of Use in http://www.unicode.org/copyright.html + . + Permission is hereby granted, free of charge, to any person obtaining + a copy of the Unicode data files and any associated documentation + (the "Data Files") or Unicode software and any associated documentation + (the "Software") to deal in the Data Files or Software + without restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, and/or sell copies of + the Data Files or Software, and to permit persons to whom the Data Files + or Software are furnished to do so, provided that either + (a) this copyright and permission notice appear with all copies + of the Data Files or Software, or + (b) this copyright and permission notice appear in associated + Documentation. + . + THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS + NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL + DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THE DATA FILES OR SOFTWARE. + . + Except as contained in this notice, the name of a copyright holder + shall not be used in advertising or otherwise to promote the sale, + use or other dealings in these Data Files or Software without prior + written authorization of the copyright holder. + License: Zlib This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/SConstruct b/SConstruct index 55b061a6f74c..f47a152126de 100644 --- a/SConstruct +++ b/SConstruct @@ -168,6 +168,8 @@ opts.Add(BoolVariable('builtin_bullet', "Use the built-in Bullet library", True) opts.Add(BoolVariable('builtin_certs', "Bundle default SSL certificates to be used if you don't specify an override in the project settings", True)) opts.Add(BoolVariable('builtin_enet', "Use the built-in ENet library", True)) opts.Add(BoolVariable('builtin_freetype', "Use the built-in FreeType library", True)) +opts.Add(BoolVariable('builtin_harfbuzz', "Use the built-in HarfBuzz library", True)) +opts.Add(BoolVariable('builtin_icu', "Use the built-in ICU library", True)) opts.Add(BoolVariable('builtin_libogg', "Use the built-in libogg library", True)) opts.Add(BoolVariable('builtin_libpng', "Use the built-in libpng library", True)) opts.Add(BoolVariable('builtin_libtheora', "Use the built-in libtheora library", True)) @@ -186,6 +188,10 @@ opts.Add(BoolVariable('builtin_xatlas', "Use the built-in xatlas library", True) opts.Add(BoolVariable('builtin_zlib', "Use the built-in zlib library", True)) opts.Add(BoolVariable('builtin_zstd', "Use the built-in Zstd library", True)) +# ICU/HarfBuzz options +opts.Add(BoolVariable('use_text_shaping', "Use ICU and HarfBuzz for BiDi and text shaping", True)) +opts.Add(BoolVariable('use_staitc_icu_data', "Use statically-linked ICU break iterator data", False)) + # Compilation environment setup opts.Add("CXX", "C++ compiler") opts.Add("CC", "C compiler") diff --git a/core/global_constants.cpp b/core/global_constants.cpp index fb90403226ae..e19d94ebc35e 100644 --- a/core/global_constants.cpp +++ b/core/global_constants.cpp @@ -108,6 +108,21 @@ void register_global_constants() { BIND_GLOBAL_ENUM_CONSTANT(VERTICAL); BIND_GLOBAL_ENUM_CONSTANT(HORIZONTAL); + BIND_GLOBAL_ENUM_CONSTANT(TEXT_DIRECTION_LTR); + BIND_GLOBAL_ENUM_CONSTANT(TEXT_DIRECTION_RTL); + BIND_GLOBAL_ENUM_CONSTANT(TEXT_DIRECTION_LOCALE); + BIND_GLOBAL_ENUM_CONSTANT(TEXT_DIRECTION_AUTO); + + BIND_GLOBAL_ENUM_CONSTANT(TEXT_JUSTIFICATION_NONE); + BIND_GLOBAL_ENUM_CONSTANT(TEXT_JUSTIFICATION_KASHIDA_AND_WHITESPACE); + BIND_GLOBAL_ENUM_CONSTANT(TEXT_JUSTIFICATION_KASHIDA_ONLY); + BIND_GLOBAL_ENUM_CONSTANT(TEXT_JUSTIFICATION_WHITESPACE_ONLY); + + BIND_GLOBAL_ENUM_CONSTANT(TEXT_BREAK_NONE); + BIND_GLOBAL_ENUM_CONSTANT(TEXT_BREAK_MANDATORY); + BIND_GLOBAL_ENUM_CONSTANT(TEXT_BREAK_MANDATORY_AND_WORD_BOUND); + BIND_GLOBAL_ENUM_CONSTANT(TEXT_BREAK_MANDATORY_AND_ANYWHERE); + BIND_GLOBAL_ENUM_CONSTANT(HALIGN_LEFT); BIND_GLOBAL_ENUM_CONSTANT(HALIGN_CENTER); BIND_GLOBAL_ENUM_CONSTANT(HALIGN_RIGHT); diff --git a/core/math/math_defs.h b/core/math/math_defs.h index c54d3cc96f36..baeb6703acc6 100644 --- a/core/math/math_defs.h +++ b/core/math/math_defs.h @@ -71,6 +71,30 @@ enum Orientation { VERTICAL }; +enum TextDirection { + + TEXT_DIRECTION_LTR, + TEXT_DIRECTION_RTL, + TEXT_DIRECTION_LOCALE, + TEXT_DIRECTION_AUTO +}; + +enum TextJustification { + + TEXT_JUSTIFICATION_NONE, + TEXT_JUSTIFICATION_KASHIDA_AND_WHITESPACE, + TEXT_JUSTIFICATION_KASHIDA_ONLY, + TEXT_JUSTIFICATION_WHITESPACE_ONLY +}; + +enum TextBreak { + + TEXT_BREAK_NONE, + TEXT_BREAK_MANDATORY, + TEXT_BREAK_MANDATORY_AND_WORD_BOUND, + TEXT_BREAK_MANDATORY_AND_ANYWHERE +}; + enum HAlign { HALIGN_LEFT, diff --git a/core/method_bind.h b/core/method_bind.h index 5ea8adb7e07a..3f05dfc1409a 100644 --- a/core/method_bind.h +++ b/core/method_bind.h @@ -182,6 +182,9 @@ VARIANT_ENUM_CAST(Error); VARIANT_ENUM_CAST(Margin); VARIANT_ENUM_CAST(Corner); VARIANT_ENUM_CAST(Orientation); +VARIANT_ENUM_CAST(TextDirection); +VARIANT_ENUM_CAST(TextJustification); +VARIANT_ENUM_CAST(TextBreak); VARIANT_ENUM_CAST(HAlign); VARIANT_ENUM_CAST(VAlign); VARIANT_ENUM_CAST(PropertyHint); diff --git a/core/ustring.cpp b/core/ustring.cpp index ff8fcaaaaf59..19d3aebc65fb 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -1391,19 +1391,28 @@ bool String::parse_utf8(const char *p_utf8, int p_len) { uint8_t c = *ptrtmp; /* Determine the number of characters in sequence */ - if ((c & 0x80) == 0) + if ((c & 0x80) == 0) { skip = 0; - else if ((c & 0xE0) == 0xC0) + } else if ((c & 0xE0) == 0xC0) { skip = 1; - else if ((c & 0xF0) == 0xE0) + } else if ((c & 0xF0) == 0xE0) { skip = 2; - else if ((c & 0xF8) == 0xF0) + } else if ((c & 0xF8) == 0xF0) { skip = 3; - else if ((c & 0xFC) == 0xF8) + if (sizeof(wchar_t) == 2) { + str_size++; //charcode > 0xFFFF, surrogate pair on windows + } + } else if ((c & 0xFC) == 0xF8) { skip = 4; - else if ((c & 0xFE) == 0xFC) + if (sizeof(wchar_t) == 2) { + str_size++; //charcode > 0xFFFF, surrogate pair on windows + } + } else if ((c & 0xFE) == 0xFC) { skip = 5; - else { + if (sizeof(wchar_t) == 2) { + str_size++; //charcode > 0xFFFF, surrogate pair on windows + } + } else { _UNICERROR("invalid skip"); return true; //invalid utf8 } @@ -1500,10 +1509,13 @@ bool String::parse_utf8(const char *p_utf8, int p_len) { //printf("char %i, len %i\n",unichar,len); if (sizeof(wchar_t) == 2 && unichar > 0xFFFF) { - unichar = ' '; //too long for windows + //too long for windows - encode as surrogate pairs + *(dst++) = ((unichar - 0x10000) >> 10) + 0xD800; + *(dst++) = ((unichar - 0x10000) & 0x3FFUL) + 0xDC00; + } else { + *(dst++) = unichar; } - *(dst++) = unichar; cstr_size -= len; p_utf8 += len; } diff --git a/core/ustring.h b/core/ustring.h index cb3d87378ac3..14160fad87db 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -28,8 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef USTRING_H -#define USTRING_H +#ifndef CORE_USTRING_H //USTRING_H conflicts with ICU's +#define CORE_USTRING_H #include "core/array.h" #include "core/cowdata.h" @@ -412,4 +412,4 @@ String RTR(const String &); bool is_symbol(CharType c); bool select_word(const String &p_s, int p_col, int &r_beg, int &r_end); -#endif // USTRING_H +#endif // CORE_USTRING_H diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index ba2eb35f8c49..f3fc99e57dbf 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -105,6 +105,42 @@ General horizontal alignment, used usually for [Separator], [ScrollBar], [Slider], etc. + + Left-to-right text writing direction. + + + Right-to-left text writing direction. + + + Text writing direction is derived from the locale's script according to the CLDR metadata. + + + Text writing direction is derived from the first character in the string with BiDi class L, R, or AL or locale's script if text is not strongly directional. + + + No text justification. + + + Use kashida and whitespace elongation to justify text. + + + Use kashida elongation to justify text. + + + Use whitespace elongation to justify text. + + + No line breaking. + + + Break lines only at mandatory break points. + + + Break lines at mandatory break points and word boundaries. + + + Break lines at mandatory break points and grapheme cluster boundaries. + Horizontal left alignment, usually for text-derived classes. diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 0ec28f93a751..fb2be65dfc8f 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -144,6 +144,27 @@ + + + + + + + + + + + + + + + + + + + Draws a paragraph of text using a custom font. + + diff --git a/doc/classes/ICUData.xml b/doc/classes/ICUData.xml new file mode 100644 index 000000000000..ea06cbf19a8e --- /dev/null +++ b/doc/classes/ICUData.xml @@ -0,0 +1,16 @@ + + + + ICD break iterator data. + + + + + + + + + + + + diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index 36aa3c8b5570..d9334fb3fd89 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -23,7 +23,7 @@ - Returns the font size in pixels. + Returns the line height in pixels. @@ -51,18 +51,28 @@ If [code]true[/code], the Label only shows the text that fits inside its bounding rectangle. It also lets you scale the node down freely. + + Language code for line-breaking and text shaping algorithms. + The node ignores the first [code]lines_skipped[/code] lines before it starts to display text. Limits the lines of text the node shows on screen. + + Comma separated list of OpenType feature tags. + More information can be found at https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags + Limits the count of visible characters. If you set [code]percent_visible[/code] to 50, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box. The text to display on screen. + + Base text writing direction. + If [code]true[/code], all the text displays as UPPERCASE. diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 1e1ffd71b5d7..b5200c47b472 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -103,9 +103,16 @@ Defines how the [code]LineEdit[/code] can grab focus (Keyboard and mouse, only keyboard, or none). See [code]enum FocusMode[/code] in [Control] for details. + + Language code for line-breaking and text shaping algorithms. + Maximum amount of characters that can be entered inside the [code]LineEdit[/code]. If [code]0[/code], there is no limit. + + Comma separated list of OpenType feature tags. + More information can be found at https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags + Opacity of the [member placeholder_text]. From [code]0[/code] to [code]1[/code]. @@ -121,6 +128,9 @@ String value of the [code]LineEdit[/code]. + + Base text writing direction. + diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 74762df15eda..3ccce0819842 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -182,6 +182,9 @@ Icon used for the project, set when project loads. Exporters will use this icon when possible to. + + Path to ICU break iterator data file. + Name of the project. It is used from both project manager and by the exporters. Overriding this as name.locale allows setting it in multiple languages. diff --git a/doc/classes/ShapedAttributedString.xml b/doc/classes/ShapedAttributedString.xml new file mode 100644 index 000000000000..40770805e4fe --- /dev/null +++ b/doc/classes/ShapedAttributedString.xml @@ -0,0 +1,109 @@ + + + + Holds shaped text and related attribute information. + + + + + + + + + + + + + + + + + + + + + Sets [code]attribute_key[/code] attribute to [code]attribute_value[/code] for specified text range. + + + + + + + Removes all attributes. + + + + + + + + + + + Returns [code]attribute_key[/code] attribute for specified text position. + + + + + + + + + + + + + Remove [code]attribute_key[/code] attribute for specified text range. + + + + + + Attribute type: "Font" + + + Attribute type: "String"]" + + Comma separated list of OpenType feature tags. + More information can be found at https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags + + + Attribute type: "String" + + Language code for line-breaking and text shaping algorithms. + + + Attribute type: "Color" + + + Attribute type: "Color" + + + Attribute type: "Color" + + + Attribute type: "float" + + + Attribute type: "Color" + + + Attribute type: "float" + + + Attribute type: "Texture" + + Embedded image. + + + Attribute type: "Size2" + + Reserved space for custom embedded object. + + + Attribute type: "VAlign" + + Embedded image/object inline alignment. + + + diff --git a/doc/classes/ShapedString.xml b/doc/classes/ShapedString.xml new file mode 100644 index 000000000000..1917e28d425e --- /dev/null +++ b/doc/classes/ShapedString.xml @@ -0,0 +1,292 @@ + + + + Holds shaped text. + + + + + + + + + + + + + + + Adds raw text to the string. + + + + + + + + + + + Break string to sub-strings to fit specified width. + + + + + + + Returns number of grapheme clusters. + + + + + + + + + + + + + + + + + + + + + + + + + Draws string. + + + + + + + + + + + + + + + + + Draws single grapheme aluster and returns advance. + + + + + + + Returns [code]true[/code] if the string is empty. + + + + + + + + + + + + + + + + + Return string ascent (number of pixels above the baseline). + + + + + + + + + Return writing direction of a character. + + + + + + + + + Return grapheme cluster ascent (number of pixels above the baseline). + + + + + + + + + Return grapheme cluster descent (number of pixels below the baseline). + + + + + + + + + Return index of the last character in grapheme cluster. + + + + + + + + + Return grapheme cluster height in pixels. + + + + + + + + + Return grapheme cluster leading edge offset in pixels. + + + + + + + + + + + + + + + + + Return index of the first character in grapheme cluster. + + + + + + + + + Return grapheme cluster trailing edge offset in pixels. + + + + + + + + + Return grapheme cluster width in pixels. + + + + + + + + + + + Returns up to two offsets corresponding to the strong and weak cursor, at the specified position. + + + + + + + Return string descent (number of pixels below the baseline). + + + + + + + Return string height in pixels. + + + + + + + + + + + Returns an array of [Rect2] enclosing the selection in the specified range. + + + + + + + Returns string width in pixels. + + + + + + + + + Returns a character index corresponding to the specified point. + + + + + + + Returns [code]true[/code] if the string is shaped successfuly. + + + + + + + Returns number of characters in the string. + + + + + + + + + + + + + + + + Base text writing direction. + + + Base text font. + + + Comma separated list of OpenType feature tags. + More information can be found at https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags + + + Language code for line-breaking and text shaping algorithms. + + + Text string. + + + + + diff --git a/drivers/SCsub b/drivers/SCsub index 583973c0255c..a89641917cf0 100644 --- a/drivers/SCsub +++ b/drivers/SCsub @@ -33,6 +33,12 @@ else: # Core dependencies SConscript("png/SCsub") +# HarfBuzz and ICU +if env['use_text_shaping']: + env.Append(CXXFLAGS=['-DUSE_TEXT_SHAPING']) + SConscript("harfbuzz/SCsub") + SConscript("icu4c/SCsub") + # Tools override # FIXME: Should likely be integrated in the tools/ codebase if env['tools']: diff --git a/drivers/harfbuzz/SCsub b/drivers/harfbuzz/SCsub new file mode 100755 index 000000000000..3aab69099d3c --- /dev/null +++ b/drivers/harfbuzz/SCsub @@ -0,0 +1,96 @@ +#!/usr/bin/env python + +Import('env') +from compat import isbasestring + +env_hb = env.Clone() + +if env['builtin_harfbuzz']: + # Thirdparty source files + thirdparty_dir = "#thirdparty/harfbuzz/" + + thirdparty_sources = [ + "src/hb-blob.cc", + "src/hb-buffer-serialize.cc", + "src/hb-buffer.cc", + "src/hb-common.cc", + "src/hb-face.cc", + "src/hb-font.cc", + "src/hb-ot-tag.cc", + "src/hb-ot-font.cc", + "src/hb-ot-layout.cc", + "src/hb-ot-map.cc", + "src/hb-ot-color.cc", + "src/hb-ot-math.cc", + "src/hb-ot-shape.cc", + "src/hb-aat-layout.cc", + "src/hb-ot-shape-complex-arabic.cc", + "src/hb-ot-shape-complex-default.cc", + "src/hb-ot-shape-complex-hangul.cc", + "src/hb-ot-shape-complex-hebrew.cc", + "src/hb-ot-shape-complex-indic.cc", + "src/hb-ot-shape-complex-indic-table.cc", + "src/hb-ot-shape-complex-myanmar.cc", + "src/hb-ot-shape-complex-khmer.cc", + "src/hb-ot-shape-complex-thai.cc", + "src/hb-ot-shape-complex-tibetan.cc", + "src/hb-ot-shape-complex-use.cc", + "src/hb-ot-shape-complex-use-table.cc", + "src/hb-ot-shape-normalize.cc", + "src/hb-ot-shape-fallback.cc", + "src/hb-ot-var.cc", + "src/hb-set.cc", + "src/hb-map.cc", + "src/hb-static.cc", + "src/hb-shape.cc", + "src/hb-shape-plan.cc", + "src/hb-shaper.cc", + "src/hb-subset-glyf.cc", + "src/hb-subset-input.cc", + "src/hb-subset-plan.cc", + "src/hb-subset.cc", + "src/hb-unicode.cc", + "src/hb-warning.cc", + "src/hb-ft.cc", + "src/hb-icu.cc", + ] + + thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] + + thirdparty_sources.append("src/hb-bitmap.cc") #custom hb interface for Godot bitmap font + + thirdparty_include_paths = [ + "src/", + "src/hb-ucdn/", + ] + + env_hb.Append(CPPPATH=["#thirdparty/freetype/include"]) + env_hb.Append(CPPPATH=["#thirdparty/icu4c/source/common/"]) + env_hb.Append(CPPFLAGS=['-DHAVE_OT', '-DHAVE_ICU_BUILTIN', '-DHAVE_ICU', '-DHAVE_FREETYPE', '-DHAVE_FT_FACE_GETCHARVARIANTINDEX', '-DHAVE_INTEL_ATOMIC_PRIMITIVES']) + env_hb.Append(CPPPATH=[thirdparty_dir + "/" + dir for dir in thirdparty_include_paths]) + env_hb.disable_warnings() + + #uses c++11 + if (not env_hb.msvc): + env_hb.Append(CXXFLAGS=["-std=c++11"]) + + env.Append(CPPPATH=[thirdparty_dir + "/" + dir for dir in thirdparty_include_paths]) + + lib = env_hb.Library("harfbuzz_builtin", thirdparty_sources) + # Needs to be appended to arrive after libscene in the linker call, + # but we don't want it to arrive *after* system libs, so manual hack + # LIBS contains first SCons Library objects ("SCons.Node.FS.File object") + # and then plain strings for system library. We insert between the two. + inserted = False + for idx, linklib in enumerate(env["LIBS"]): + if isbasestring(linklib): # first system lib such as "X11", otherwise SCons lib object + env["LIBS"].insert(idx, lib) + inserted = True + break + + if not inserted: + env.Append(LIBS=[lib]) +else: + env.drivers_sources.append("src/hb-bitmap.cc") #custom hb interface for Godot bitmap font + +Export('env') diff --git a/drivers/harfbuzz/src/hb-bitmap.cc b/drivers/harfbuzz/src/hb-bitmap.cc new file mode 100644 index 000000000000..6fe91766da4d --- /dev/null +++ b/drivers/harfbuzz/src/hb-bitmap.cc @@ -0,0 +1,201 @@ +/*************************************************************************/ +/* hb-bitmap.cc */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "scene/resources/font.h" + +#include "hb-private.hh" + +#include "hb-bitmap.h" +#include "hb-font-private.hh" +#include "hb-machinery-private.hh" + +struct hb_bmp_font_t { + BitmapFont *bm_face; + bool unref; /* Whether to destroy bm_face when done. */ +}; + +static hb_bmp_font_t *_hb_bmp_font_create(BitmapFont *bm_face, bool unref) { + hb_bmp_font_t *bm_font = (hb_bmp_font_t *)calloc(1, sizeof(hb_bmp_font_t)); + + if (unlikely(!bm_font)) + return nullptr; + + bm_font->bm_face = bm_face; + bm_font->unref = unref; + + return bm_font; +} + +static void _hb_bmp_font_destroy(void *data) { + hb_bmp_font_t *bm_font = (hb_bmp_font_t *)data; + free(bm_font); +} + +static hb_bool_t hb_bmp_get_nominal_glyph(hb_font_t *font HB_UNUSED, void *font_data, hb_codepoint_t unicode, hb_codepoint_t *glyph, void *user_data HB_UNUSED) { + const hb_bmp_font_t *bm_font = (const hb_bmp_font_t *)font_data; + + if (!bm_font->bm_face) + return false; + + if (!bm_font->bm_face->has_character(unicode)) { + if (bm_font->bm_face->has_character(0xF000u + unicode)) { + *glyph = 0xF000u + unicode; + return true; + } else { + return false; + } + } + + *glyph = unicode; + return true; +} + +static hb_position_t hb_bmp_get_glyph_h_advance(hb_font_t *font, void *font_data, hb_codepoint_t glyph, void *user_data HB_UNUSED) { + const hb_bmp_font_t *bm_font = (const hb_bmp_font_t *)font_data; + + if (!bm_font->bm_face) + return 0; + + if (!bm_font->bm_face->has_character(glyph)) + return 0; + + return bm_font->bm_face->get_character(glyph).advance * 64; +} + +static hb_position_t hb_bmp_get_glyph_h_kerning(hb_font_t *font, void *font_data, hb_codepoint_t left_glyph, hb_codepoint_t right_glyph, void *user_data HB_UNUSED) { + const hb_bmp_font_t *bm_font = (const hb_bmp_font_t *)font_data; + + if (!bm_font->bm_face) + return 0; + + if (!bm_font->bm_face->has_character(left_glyph)) + return 0; + + if (!bm_font->bm_face->has_character(right_glyph)) + return 0; + + return bm_font->bm_face->get_kerning_pair(left_glyph, right_glyph) * 64; +} + +static hb_bool_t hb_bmp_get_glyph_v_origin(hb_font_t *font, void *font_data, hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y, void *user_data HB_UNUSED) { + const hb_bmp_font_t *bm_font = (const hb_bmp_font_t *)font_data; + + if (!bm_font->bm_face) + return false; + + if (!bm_font->bm_face->has_character(glyph)) + return false; + + *x = bm_font->bm_face->get_character(glyph).h_align * 64; + *y = bm_font->bm_face->get_character(glyph).v_align * 64; + + return true; +} + +static hb_bool_t hb_bmp_get_glyph_extents(hb_font_t *font, void *font_data, hb_codepoint_t glyph, hb_glyph_extents_t *extents, void *user_data HB_UNUSED) { + const hb_bmp_font_t *bm_font = (const hb_bmp_font_t *)font_data; + + if (!bm_font->bm_face) + return false; + + if (!bm_font->bm_face->has_character(glyph)) + return false; + + extents->x_bearing = 0; + extents->y_bearing = 0; + extents->width = bm_font->bm_face->get_character(glyph).rect.size.x * 64; + extents->height = bm_font->bm_face->get_character(glyph).rect.size.y * 64; + + return true; +} + +static hb_bool_t hb_bmp_get_font_h_extents(hb_font_t *font HB_UNUSED, void *font_data, hb_font_extents_t *metrics, void *user_data HB_UNUSED) { + const hb_bmp_font_t *bm_font = (const hb_bmp_font_t *)font_data; + + if (!bm_font->bm_face) + return false; + + metrics->ascender = bm_font->bm_face->get_ascent(); + metrics->descender = bm_font->bm_face->get_descent(); + metrics->line_gap = 0; + + return true; +} + +static struct hb_bmp_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t { + static inline hb_font_funcs_t *create(void) { + hb_font_funcs_t *funcs = hb_font_funcs_create(); + + hb_font_funcs_set_font_h_extents_func(funcs, hb_bmp_get_font_h_extents, nullptr, nullptr); + //hb_font_funcs_set_font_v_extents_func (funcs, hb_bmp_get_font_v_extents, nullptr, nullptr); + hb_font_funcs_set_nominal_glyph_func(funcs, hb_bmp_get_nominal_glyph, nullptr, nullptr); + //hb_font_funcs_set_variation_glyph_func (funcs, hb_bmp_get_variation_glyph, nullptr, nullptr); + hb_font_funcs_set_glyph_h_advance_func(funcs, hb_bmp_get_glyph_h_advance, nullptr, nullptr); + //hb_font_funcs_set_glyph_v_advance_func (funcs, hb_bmp_get_glyph_v_advance, nullptr, nullptr); + //hb_font_funcs_set_glyph_h_origin_func (funcs, hb_bmp_get_glyph_h_origin, nullptr, nullptr); + hb_font_funcs_set_glyph_v_origin_func(funcs, hb_bmp_get_glyph_v_origin, nullptr, nullptr); + hb_font_funcs_set_glyph_h_kerning_func(funcs, hb_bmp_get_glyph_h_kerning, nullptr, nullptr); + //hb_font_funcs_set_glyph_v_kerning_func (funcs, hb_bmp_get_glyph_v_kerning, nullptr, nullptr); + hb_font_funcs_set_glyph_extents_func(funcs, hb_bmp_get_glyph_extents, nullptr, nullptr); + //hb_font_funcs_set_glyph_contour_point_func (funcs, hb_bmp_get_glyph_contour_point, nullptr, nullptr); + //hb_font_funcs_set_glyph_name_func (funcs, hb_bmp_get_glyph_name, nullptr, nullptr); + //hb_font_funcs_set_glyph_from_name_func (funcs, hb_bmp_get_glyph_from_name, nullptr, nullptr); + + hb_font_funcs_make_immutable(funcs); + +#ifdef HB_USE_ATEXIT + atexit(free_static_bmp_funcs); +#endif + + return funcs; + } +} static_bmp_funcs; + +#ifdef HB_USE_ATEXIT +static void free_static_bmp_funcs(void) { + static_bmp_funcs.free_instance(); +} +#endif + +static hb_font_funcs_t *_hb_bmp_get_font_funcs(void) { + return static_bmp_funcs.get_unconst(); +} + +static void _hb_bmp_font_set_funcs(hb_font_t *font, BitmapFont *bm_face, bool unref) { + hb_font_set_funcs(font, _hb_bmp_get_font_funcs(), _hb_bmp_font_create(bm_face, unref), _hb_bmp_font_destroy); +} + +hb_font_t *hb_bmp_font_create(BitmapFont *bm_face, hb_destroy_func_t destroy) { + hb_font_t *font; + + font = hb_font_create(hb_face_create(NULL, 0)); + _hb_bmp_font_set_funcs(font, bm_face, false); + return font; +} diff --git a/drivers/harfbuzz/src/hb-bitmap.h b/drivers/harfbuzz/src/hb-bitmap.h new file mode 100644 index 000000000000..f33585190140 --- /dev/null +++ b/drivers/harfbuzz/src/hb-bitmap.h @@ -0,0 +1,44 @@ +/*************************************************************************/ +/* hb-bitmap.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef HB_BITMAP_H +#define HB_BITMAP_H + +#include "hb.h" + +HB_BEGIN_DECLS + +class BitmapFont; + +HB_EXTERN hb_font_t *hb_bmp_font_create(BitmapFont *bm_face, hb_destroy_func_t destroy); + +HB_END_DECLS + +#endif /* HB_BITMAP_H */ diff --git a/drivers/icu4c/SCsub b/drivers/icu4c/SCsub new file mode 100755 index 000000000000..40cd64dbd776 --- /dev/null +++ b/drivers/icu4c/SCsub @@ -0,0 +1,271 @@ +#!/usr/bin/env python + +Import('env') +from compat import isbasestring + +env_icu = env.Clone() + +def make_icu_data(target, source, env): + import os + from compat import encode_utf8, byte_to_str, open_utf8 + + dst = target[0].srcnode().abspath + + g = open_utf8(dst, "w") + + g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") + g.write("/* (C) 2016 and later: Unicode, Inc. and others. */\n") + g.write("/* License & terms of use: http://www.unicode.org/copyright.html */\n") + g.write("#ifndef _ICU_DATA_H\n") + g.write("#define _ICU_DATA_H\n") + g.write("#include \"unicode/utypes.h\"\n") + g.write("#include \"unicode/udata.h\"\n") + g.write("#include \"unicode/uversion.h\"\n") + + f = open(source[0].srcnode().abspath, "rb") + buf = f.read() + import os.path + + g.write("extern \"C\" U_EXPORT const unsigned char U_ICUDATA_ENTRY_POINT[] = {\n") + for i in range(len(buf)): + g.write(byte_to_str(buf[i]) + ",\n") + + g.write("};\n") + g.write("#endif") + +if env['builtin_icu']: + # Thirdparty source files + thirdparty_dir = "#thirdparty/icu4c/" + + thirdparty_sources = [ + "source/common/appendable.cpp", + "source/common/bmpset.cpp", + "source/common/brkeng.cpp", + "source/common/brkiter.cpp", + "source/common/bytesinkutil.cpp", + "source/common/bytestream.cpp", + "source/common/bytestrie.cpp", + "source/common/bytestriebuilder.cpp", + "source/common/bytestrieiterator.cpp", + "source/common/caniter.cpp", + "source/common/chariter.cpp", + "source/common/charstr.cpp", + "source/common/cmemory.cpp", + #"source/common/cstr.cpp", + "source/common/cstring.cpp", + #"source/common/cwchar.cpp", + "source/common/dictbe.cpp", + "source/common/dictionarydata.cpp", + #"source/common/dtintrv.cpp", + "source/common/edits.cpp", + "source/common/errorcode.cpp", + "source/common/filteredbrk.cpp", + "source/common/filterednormalizer2.cpp", + #"source/common/icudataver.cpp", + #"source/common/icuplug.cpp", + "source/common/listformatter.cpp", + "source/common/loadednormalizer2impl.cpp", + "source/common/locavailable.cpp", + "source/common/locbased.cpp", + "source/common/locdispnames.cpp", + "source/common/locdspnm.cpp", + "source/common/locid.cpp", + "source/common/loclikely.cpp", + "source/common/locmap.cpp", + "source/common/locresdata.cpp", + "source/common/locutil.cpp", + #"source/common/messagepattern.cpp", + "source/common/normalizer2.cpp", + "source/common/normalizer2impl.cpp", + #"source/common/normlzr.cpp", + "source/common/parsepos.cpp", + "source/common/patternprops.cpp", + #"source/common/pluralmap.cpp", + "source/common/propname.cpp", + "source/common/propsvec.cpp", + #"source/common/punycode.cpp", + "source/common/putil.cpp", + "source/common/rbbi.cpp", + "source/common/rbbi_cache.cpp", + "source/common/rbbidata.cpp", + "source/common/rbbinode.cpp", + "source/common/rbbirb.cpp", + "source/common/rbbiscan.cpp", + "source/common/rbbisetb.cpp", + "source/common/rbbistbl.cpp", + "source/common/rbbitblb.cpp", + "source/common/resbund.cpp", + #"source/common/resbund_cnv.cpp", + "source/common/resource.cpp", + "source/common/ruleiter.cpp", + "source/common/schriter.cpp", + "source/common/serv.cpp", + "source/common/servlk.cpp", + "source/common/servlkf.cpp", + "source/common/servls.cpp", + "source/common/servnotf.cpp", + "source/common/servrbf.cpp", + "source/common/servslkf.cpp", + #"source/common/sharedobject.cpp", + #"source/common/simpleformatter.cpp", + "source/common/stringpiece.cpp", + "source/common/stringtriebuilder.cpp", + "source/common/uarrsort.cpp", + "source/common/ubidi.cpp", + "source/common/ubidi_props.cpp", + "source/common/ubidiln.cpp", + "source/common/ubiditransform.cpp", + "source/common/ubidiwrt.cpp", + "source/common/ubrk.cpp", + "source/common/ucase.cpp", + #"source/common/ucasemap.cpp", + #"source/common/ucasemap_titlecase_brkiter.cpp", + #"source/common/ucat.cpp", + "source/common/uchar.cpp", + "source/common/ucharstrie.cpp", + "source/common/ucharstriebuilder.cpp", + "source/common/ucharstrieiterator.cpp", + "source/common/uchriter.cpp", + "source/common/ucln_cmn.cpp", + "source/common/ucmndata.cpp", + #"source/common/ucnv.cpp", + #"source/common/ucnv2022.cpp", + #"source/common/ucnv_bld.cpp", + #"source/common/ucnv_cb.cpp", + #"source/common/ucnv_cnv.cpp", + #"source/common/ucnv_ct.cpp", + #"source/common/ucnv_err.cpp", + #"source/common/ucnv_ext.cpp", + "source/common/ucnv_io.cpp", + #"source/common/ucnv_lmb.cpp", + #"source/common/ucnv_set.cpp", + #"source/common/ucnv_u16.cpp", + #"source/common/ucnv_u32.cpp", + #"source/common/ucnv_u7.cpp", + #"source/common/ucnv_u8.cpp", + #"source/common/ucnvbocu.cpp", + #"source/common/ucnvdisp.cpp", + #"source/common/ucnvhz.cpp", + #"source/common/ucnvisci.cpp", + #"source/common/ucnvlat1.cpp", + #"source/common/ucnvmbcs.cpp", + #"source/common/ucnvscsu.cpp", + #"source/common/ucnvsel.cpp", + "source/common/ucol_swp.cpp", + "source/common/udata.cpp", + "source/common/udatamem.cpp", + "source/common/udataswp.cpp", + "source/common/uenum.cpp", + "source/common/uhash.cpp", + "source/common/uhash_us.cpp", + "source/common/uidna.cpp", + "source/common/uinit.cpp", + "source/common/uinvchar.cpp", + "source/common/uiter.cpp", + #"source/common/ulist.cpp", + #"source/common/ulistformatter.cpp", + "source/common/uloc.cpp", + "source/common/uloc_keytype.cpp", + "source/common/uloc_tag.cpp", + "source/common/umapfile.cpp", + "source/common/umath.cpp", + "source/common/umutex.cpp", + "source/common/unames.cpp", + #"source/common/unifiedcache.cpp", + "source/common/unifilt.cpp", + "source/common/unifunct.cpp", + "source/common/uniset.cpp", + "source/common/uniset_closure.cpp", + "source/common/uniset_props.cpp", + "source/common/unisetspan.cpp", + "source/common/unistr.cpp", + "source/common/unistr_case.cpp", + #"source/common/unistr_case_locale.cpp", + #"source/common/unistr_cnv.cpp", + "source/common/unistr_props.cpp", + #"source/common/unistr_titlecase_brkiter.cpp", + "source/common/unorm.cpp", + "source/common/unormcmp.cpp", + "source/common/uobject.cpp", + "source/common/uprops.cpp", + #"source/common/ures_cnv.cpp", + "source/common/uresbund.cpp", + "source/common/uresdata.cpp", + #"source/common/usc_impl.cpp", + "source/common/uscript.cpp", + "source/common/uscript_props.cpp", + #"source/common/uset.cpp", + #"source/common/uset_props.cpp", + #"source/common/usetiter.cpp", + #"source/common/ushape.cpp", + #"source/common/usprep.cpp", + "source/common/ustack.cpp", + "source/common/ustr_cnv.cpp", + "source/common/ustr_titlecase_brkiter.cpp", + "source/common/ustr_wcs.cpp", + "source/common/ustrcase.cpp", + "source/common/ustrcase_locale.cpp", + "source/common/ustrenum.cpp", + "source/common/ustrfmt.cpp", + "source/common/ustring.cpp", + "source/common/ustrtrns.cpp", + "source/common/utext.cpp", + "source/common/utf_impl.cpp", + "source/common/util.cpp", + "source/common/util_props.cpp", + "source/common/utrace.cpp", + "source/common/utrie.cpp", + "source/common/utrie2.cpp", + "source/common/utrie2_builder.cpp", + #"source/common/uts46.cpp", + "source/common/utypes.cpp", + "source/common/uvector.cpp", + "source/common/uvectr32.cpp", + "source/common/uvectr64.cpp", + "source/common/wintz.cpp", + ] + + if env['use_staitc_icu_data']: + env.Depends('#thirdparty/icu4c/source/data/icudata.gen.h', '#thirdparty/icu4c/source/data/icudt60l.dat') + env.Command('#thirdparty/icu4c/source/data/icudata.gen.h', '#thirdparty/icu4c/source/data/icudt60l.dat', make_icu_data) + + thirdparty_sources.append("source/data/icudata_static.cpp") + else: + thirdparty_sources.append("source/data/icudata_stub.cpp") + + + thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] + + thirdparty_include_paths = [ + "source/common/", + ] + env_icu.Append(CPPPATH=[thirdparty_dir + "/" + dir for dir in thirdparty_include_paths]) + env_icu.Append(CXXFLAGS=['-DU_STATIC_IMPLEMENTATION', '-DU_COMMON_IMPLEMENTATION', '-DPKGDATA_MODE=static', '-DU_HAVE_ATOMIC=1']) + env_icu.disable_warnings() + + #uses c++11 + if (not env_icu.msvc): + env_icu.Append(CXXFLAGS=['-std=c++11']) + + #!!! remove '-DU_SHOW_CPLUSPLUS_API=0' and '-DUCHAR_TYPE=uint16_t' after moving to C++11 + env.Append(CXXFLAGS=['-DU_SHOW_CPLUSPLUS_API=0', '-DU_HIDE_DEPRECATED_API', '-DU_HIDE_OBSOLETE_API', '-DU_HIDE_INTERNAL_API', '-DUCHAR_TYPE=uint16_t']) + #!!! remove '-DU_SHOW_CPLUSPLUS_API=0' and '-DUCHAR_TYPE=uint16_t' after moving to C++11 + + env.Append(CPPPATH=[thirdparty_dir + "/" + dir for dir in thirdparty_include_paths]) + + lib = env_icu.Library("icu_builtin", thirdparty_sources) + # Needs to be appended to arrive after libscene in the linker call, + # but we don't want it to arrive *after* system libs, so manual hack + # LIBS contains first SCons Library objects ("SCons.Node.FS.File object") + # and then plain strings for system library. We insert between the two. + inserted = False + for idx, linklib in enumerate(env["LIBS"]): + if isbasestring(linklib): # first system lib such as "X11", otherwise SCons lib object + env["LIBS"].insert(idx, lib) + inserted = True + break + + if not inserted: + env.Append(LIBS=[lib]) + +Export('env') diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index c05db2571be2..0e0bc372eec4 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -826,6 +826,17 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_color("clear_button_color", "LineEdit", font_color); theme->set_color("clear_button_color_pressed", "LineEdit", accent_color); + // LineEditLegacy + theme->set_stylebox("normal", "LineEditLegacy", style_widget); + theme->set_stylebox("focus", "LineEditLegacy", style_widget_focus); + theme->set_stylebox("read_only", "LineEditLegacy", style_widget_disabled); + theme->set_color("read_only", "LineEditLegacy", font_color_disabled); + theme->set_color("font_color", "LineEditLegacy", font_color); + theme->set_color("cursor_color", "LineEditLegacy", font_color); + theme->set_color("selection_color", "LineEditLegacy", font_color_selection); + theme->set_color("clear_button_color", "LineEditLegacy", font_color); + theme->set_color("clear_button_color_pressed", "LineEditLegacy", accent_color); + // TextEdit theme->set_stylebox("normal", "TextEdit", style_widget); theme->set_stylebox("focus", "TextEdit", style_widget_hover); @@ -940,6 +951,15 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_constant("shadow_as_outline", "Label", 0 * EDSCALE); theme->set_constant("line_spacing", "Label", 3 * EDSCALE); + // LabelLegacy + theme->set_stylebox("normal", "LabelLegacy", style_empty); + theme->set_color("font_color", "LabelLegacy", font_color); + theme->set_color("font_color_shadow", "LabelLegacy", Color(0, 0, 0, 0)); + theme->set_constant("shadow_offset_x", "LabelLegacy", 1 * EDSCALE); + theme->set_constant("shadow_offset_y", "LabelLegacy", 1 * EDSCALE); + theme->set_constant("shadow_as_outline", "LabelLegacy", 0 * EDSCALE); + theme->set_constant("line_spacing", "LabelLegacy", 3 * EDSCALE); + // LinkButton theme->set_stylebox("focus", "LinkButton", style_empty); theme->set_color("font_color", "LinkButton", font_color); diff --git a/editor/icons/icon_i_c_u_data.svg b/editor/icons/icon_i_c_u_data.svg new file mode 100644 index 000000000000..10710d5bd563 --- /dev/null +++ b/editor/icons/icon_i_c_u_data.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/editor/icons/icon_label_legacy.svg b/editor/icons/icon_label_legacy.svg new file mode 100644 index 000000000000..f126a68a4e59 --- /dev/null +++ b/editor/icons/icon_label_legacy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/editor/icons/icon_legacy_control.svg b/editor/icons/icon_legacy_control.svg new file mode 100644 index 000000000000..6b060f0f2f42 --- /dev/null +++ b/editor/icons/icon_legacy_control.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/editor/icons/icon_line_edit_legacy.svg b/editor/icons/icon_line_edit_legacy.svg new file mode 100644 index 000000000000..eb9e64b5e214 --- /dev/null +++ b/editor/icons/icon_line_edit_legacy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/editor/icons/icon_shaped_attributed_string.svg b/editor/icons/icon_shaped_attributed_string.svg new file mode 100644 index 000000000000..fa980f3e98b1 --- /dev/null +++ b/editor/icons/icon_shaped_attributed_string.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/editor/icons/icon_shaped_string.svg b/editor/icons/icon_shaped_string.svg new file mode 100644 index 000000000000..2d5c7dce1f46 --- /dev/null +++ b/editor/icons/icon_shaped_string.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/editor/output_strings.cpp b/editor/output_strings.cpp index 24b44f078fa1..2d48a23553e0 100644 --- a/editor/output_strings.cpp +++ b/editor/output_strings.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "output_strings.h" +#include "scene/resources/shaped_string.h" void OutputStrings::update_scrollbars() { @@ -108,20 +109,25 @@ void OutputStrings::_notification(int p_what) { default: {} } - line_ofs.y += font->get_ascent(); + ShapedString line; + line.set_base_direction(TEXT_DIRECTION_AUTO); + line.set_base_font(font); + line.set_text(str); + + line_ofs.y += line.get_ascent(); line_ofs.x += icon_error->get_width() + 4; - for (int i = 0; i < str.length(); i++) { + for (int i = 0; i < line.clusters(); i++) { if (line_ofs.x - h_ofs < 0) { - line_ofs.x += font->get_char_size(str[i], str[i + 1]).width; + line_ofs.x += line.get_cluster_width(i); } else if (line_ofs.x - h_ofs > size.width - margin.width) { break; } else { - line_ofs.x += font->draw_char(ci, Point2(line_ofs.x - h_ofs, line_ofs.y), str[i], str[i + 1], color); + line_ofs += line.draw_cluster(ci, Point2(line_ofs.x - h_ofs, line_ofs.y), i, color, false); } } + ofs.y += line.get_height(); - ofs.y += font_height; E = E->next(); } diff --git a/main/main.cpp b/main/main.cpp index 3dff9d89bdb3..c2c5ef4c414b 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1189,6 +1189,9 @@ Error Main::setup2(Thread::ID p_main_tid_override) { GLOBAL_DEF("application/config/icon", String()); ProjectSettings::get_singleton()->set_custom_property_info("application/config/icon", PropertyInfo(Variant::STRING, "application/config/icon", PROPERTY_HINT_FILE, "*.png,*.webp")); + GLOBAL_DEF("application/config/icudata", String()); + ProjectSettings::get_singleton()->set_custom_property_info("application/config/icudata", PropertyInfo(Variant::STRING, "application/config/icudata", PROPERTY_HINT_FILE, "*.icudt")); + InputDefault *id = Object::cast_to(Input::get_singleton()); if (id) { if (bool(GLOBAL_DEF("input_devices/pointing/emulate_touch_from_mouse", false)) && !(editor || project_manager)) { diff --git a/main/tests/test_main.cpp b/main/tests/test_main.cpp index 22f1d7319f89..22556798daa3 100644 --- a/main/tests/test_main.cpp +++ b/main/tests/test_main.cpp @@ -43,6 +43,7 @@ #include "test_physics_2d.h" #include "test_render.h" #include "test_shader_lang.h" +#include "test_shaping.h" #include "test_string.h" const char **tests_get_names() { @@ -62,6 +63,7 @@ const char **tests_get_names() { "gd_bytecode", "ordered_hash_map", "astar", + "shaping", NULL }; @@ -142,7 +144,13 @@ MainLoop *test_main(String p_test, const List &p_args) { return TestAStar::test(); } + if (p_test == "shaping") { + + return TestShaping::test(); + } + print_line("Unknown test: " + p_test); + return NULL; } diff --git a/main/tests/test_shaping.cpp b/main/tests/test_shaping.cpp new file mode 100644 index 000000000000..2a5d301c2802 --- /dev/null +++ b/main/tests/test_shaping.cpp @@ -0,0 +1,148 @@ +/*************************************************************************/ +/* test_shaping.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "test_shaping.h" + +#include "core/math/math_funcs.h" +#include "core/os/file_access.h" +#include "core/os/main_loop.h" +#include "core/os/os.h" +#include "scene/resources/dynamic_font.h" +#include "scene/resources/shaped_attributed_string.h" +#include "servers/visual_server.h" + +namespace TestShaping { + +class TestMainLoop : public MainLoop { + + ShapedAttributedString as1; + + RID canvas; + RID vp; + RID item; + + //Fonts + Ref default_font; + + bool quit; + +public: + virtual void input_event(const Ref &p_event) { + + if (p_event->is_pressed()) + quit = true; + } + + virtual void init() { + print_line("INITIALIZING SHAPING TEST"); + + //Load fonts + bool fonts_ok = true; + String font_path; + List cmdline = OS::get_singleton()->get_cmdline_args(); + for (List::Element *E = cmdline.front(); E; E = E->next()) { + if (E->get() == "--datapath") { + if (E->next()) { + font_path = E->next()->get(); + break; + } + } + } + + if (FileAccess::exists(font_path + "NotoSans-Regular.ttf")) { + default_font.instance(); + default_font->set_size(30); + Ref default_font_data; + default_font_data.instance(); + default_font_data->set_font_path(font_path + "NotoSans-Regular.ttf"); + default_font->set_font_data(default_font_data); + } else { + print_line(" \"NotoSans-Regular.ttf\" not found"); + fonts_ok = false; + } + + if (!fonts_ok) { + print_line("Usage: \"godot --test shaping --datapath {PATH}\""); + quit = true; + return; + } + + //Load ICU data + + //Init canvas + VisualServer *vs = VisualServer::get_singleton(); + vp = vs->viewport_create(); + canvas = vs->canvas_create(); + Size2i screen_size = OS::get_singleton()->get_window_size(); + vs->viewport_attach_canvas(vp, canvas); + vs->viewport_set_size(vp, screen_size.x, screen_size.y); + vs->viewport_attach_to_screen(vp, Rect2(Vector2(), screen_size)); + vs->viewport_set_active(vp, true); + + item = vs->canvas_item_create(); + vs->canvas_item_set_parent(item, canvas); + + //Build and draw test strings + as1.set_base_font(default_font); + as1.set_text("Test Attributes 1.0 = XXXX"); + as1.add_attribute(TEXT_ATTRIBUTE_COLOR, Color(0.5, 1, 0.5, 0.7), 0, 4); + as1.add_attribute(TEXT_ATTRIBUTE_COLOR, Color(1, 0.5, 1, 1), 16, 17); + as1.draw(item, Point2(20, 120), Color(1, 1, 1), false); + + vs->canvas_item_add_line(item, Point2(20, 120), Point2(20 + as1.get_width(), 120), Color(0, 1, 0, 0.2), 2); + vs->canvas_item_add_line(item, Point2(20, 120 - as1.get_ascent()), Point2(20 + as1.get_width(), 120 - as1.get_ascent()), Color(1, 0, 0, 0.2), 2); + vs->canvas_item_add_line(item, Point2(20, 120 + as1.get_descent()), Point2(20 + as1.get_width(), 120 + as1.get_descent()), Color(1, 0, 1, 0.2), 2); + + quit = false; + } + + virtual bool iteration(float p_time) { + + return quit; + } + + virtual bool idle(float p_time) { + + return quit; + } + + virtual void finish() { + + VisualServer::get_singleton()->free(item); + VisualServer::get_singleton()->free(canvas); + VisualServer::get_singleton()->free(vp); + } +}; + +MainLoop *test() { + + return memnew(TestMainLoop); +} +} // namespace TestShaping diff --git a/main/tests/test_shaping.h b/main/tests/test_shaping.h new file mode 100644 index 000000000000..024f3446ebad --- /dev/null +++ b/main/tests/test_shaping.h @@ -0,0 +1,45 @@ +/*************************************************************************/ +/* test_shaping.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef TEST_SHAPING_H +#define TEST_SHAPING_H + +/** + @author Juan Linietsky +*/ + +#include "core/os/main_loop.h" + +namespace TestShaping { + +MainLoop *test(); +} + +#endif diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 47da8de5df61..0384ee54fb10 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -110,11 +110,8 @@ def configure(env): # No multi-threading (SharedArrayBuffer) available yet, # once feasible also consider memory buffer size issues. env.Append(CPPDEFINES=['NO_THREADS']) - - # These flags help keep the file size down. - env.Append(CCFLAGS=['-fno-exceptions', '-fno-rtti']) - # Don't use dynamic_cast, necessary with no-rtti. - env.Append(CPPDEFINES=['NO_SAFE_CAST']) + # These flags help keep the file size down + env.Append(CPPFLAGS=["-fno-exceptions"]) #, '-fno-rtti' - dynamic_cast required by ICU if env['javascript_eval']: env.Append(CPPDEFINES=['JAVASCRIPT_EVAL_ENABLED']) diff --git a/platform/x11/detect.py b/platform/x11/detect.py index b5ad59e60a5f..abbd6a4676e5 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -203,6 +203,12 @@ def configure(env): sys.exit(255) env.ParseConfig('pkg-config bullet --cflags --libs') + if not env['builtin_harfbuzz']: + env.ParseConfig('pkg-config harfbuzz --cflags --libs') + + if not env['builtin_icu']: + env.ParseConfig('pkg-config icu-uc --cflags --libs') + if not env['builtin_enet']: env.ParseConfig('pkg-config libenet --cflags --libs') diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 2739f7154367..b7a63a8f9fba 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -918,6 +918,17 @@ void CanvasItem::draw_string(const Ref &p_font, const Point2 &p_pos, const p_font->draw(canvas_item, p_pos, p_text, p_modulate, p_clip_w); } +void CanvasItem::draw_paragraph(const Ref &p_font, const Point2 &p_pos, const String &p_text, const Color &p_modulate, int p_clip_w, TextBreak p_bflags, TextJustification p_jflags) { + + if (!drawing) { + ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); + ERR_FAIL(); + } + + ERR_FAIL_COND(p_font.is_null()); + p_font->draw_paragraph(canvas_item, p_pos, p_text, p_modulate, p_clip_w, p_modulate, p_bflags, p_jflags); +} + float CanvasItem::draw_char(const Ref &p_font, const Point2 &p_pos, const String &p_char, const String &p_next, const Color &p_modulate) { if (!drawing) { @@ -1167,6 +1178,7 @@ void CanvasItem::_bind_methods() { ClassDB::bind_method(D_METHOD("draw_polygon", "points", "colors", "uvs", "texture", "normal_map", "antialiased"), &CanvasItem::draw_polygon, DEFVAL(PoolVector2Array()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(false)); ClassDB::bind_method(D_METHOD("draw_colored_polygon", "points", "color", "uvs", "texture", "normal_map", "antialiased"), &CanvasItem::draw_colored_polygon, DEFVAL(PoolVector2Array()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(false)); ClassDB::bind_method(D_METHOD("draw_string", "font", "position", "text", "modulate", "clip_w"), &CanvasItem::draw_string, DEFVAL(Color(1, 1, 1)), DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("draw_paragraph", "font", "position", "text", "modulate", "clip_w", "break_flags", "just_flags"), &CanvasItem::draw_paragraph, DEFVAL(Color(1, 1, 1)), DEFVAL(-1), DEFVAL(TEXT_BREAK_MANDATORY_AND_WORD_BOUND), DEFVAL(TEXT_JUSTIFICATION_KASHIDA_AND_WHITESPACE)); ClassDB::bind_method(D_METHOD("draw_char", "font", "position", "char", "next", "modulate"), &CanvasItem::draw_char, DEFVAL(Color(1, 1, 1))); ClassDB::bind_method(D_METHOD("draw_mesh", "mesh", "texture", "normal_map"), &CanvasItem::draw_mesh, DEFVAL(Ref())); ClassDB::bind_method(D_METHOD("draw_multimesh", "multimesh", "texture", "normal_map"), &CanvasItem::draw_multimesh, DEFVAL(Ref())); diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h index bf7cfa8e7581..02de11f9dc83 100644 --- a/scene/2d/canvas_item.h +++ b/scene/2d/canvas_item.h @@ -33,14 +33,15 @@ #include "scene/main/node.h" #include "scene/main/scene_tree.h" +#include "scene/resources/font.h" #include "scene/resources/material.h" #include "scene/resources/multimesh.h" #include "scene/resources/shader.h" +#include "scene/resources/shaped_string.h" #include "scene/resources/texture.h" class CanvasLayer; class Viewport; -class Font; class StyleBox; @@ -321,6 +322,8 @@ class CanvasItem : public Node { void draw_multimesh(const Ref &p_multimesh, const Ref &p_texture, const Ref &p_normal_map); void draw_string(const Ref &p_font, const Point2 &p_pos, const String &p_text, const Color &p_modulate = Color(1, 1, 1), int p_clip_w = -1); + void draw_paragraph(const Ref &p_font, const Point2 &p_pos, const String &p_text, const Color &p_modulate = Color(1, 1, 1), int p_clip_w = -1, TextBreak p_bflags = TEXT_BREAK_MANDATORY_AND_WORD_BOUND, TextJustification p_jflags = TEXT_JUSTIFICATION_KASHIDA_AND_WHITESPACE); + float draw_char(const Ref &p_font, const Point2 &p_pos, const String &p_char, const String &p_next = "", const Color &p_modulate = Color(1, 1, 1)); void draw_set_transform(const Point2 &p_offset, float p_rot, const Size2 &p_scale); diff --git a/scene/SCsub b/scene/SCsub index d8839ce3a8ab..e3931a626c20 100644 --- a/scene/SCsub +++ b/scene/SCsub @@ -25,6 +25,7 @@ env.add_source_files(env.scene_sources, "*.cpp") # Chain load SCsubs SConscript('main/SCsub') SConscript('gui/SCsub') +SConscript('gui/legacy/SCsub') SConscript('3d/SCsub') SConscript('2d/SCsub') SConscript('animation/SCsub') diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 026374ded1d0..35aec86b1e2a 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1128,45 +1128,14 @@ void ItemList::_notification(int p_what) { if (icon_mode == ICON_MODE_TOP && max_text_lines > 0) { - int ss = items[i].text.length(); - float ofs = 0; - int line = 0; - for (int j = 0; j <= ss; j++) { - - int cs = j < ss ? font->get_char_size(items[i].text[j], items[i].text[j + 1]).x : 0; - if (ofs + cs > max_len || j == ss) { - line_limit_cache.write[line] = j; - line_size_cache.write[line] = ofs; - line++; - ofs = 0; - if (line >= max_text_lines) - break; - } else { - ofs += cs; - } - } - - line = 0; - ofs = 0; - + //special multiline mode text_ofs.y += font->get_ascent(); text_ofs = text_ofs.floor(); text_ofs += base_ofs; text_ofs += items[i].rect_cache.position; - FontDrawer drawer(font, Color(1, 1, 1)); - for (int j = 0; j < ss; j++) { + draw_paragraph(font, text_ofs, items[i].text, modulate, max_len + 1, TEXT_BREAK_MANDATORY_AND_ANYWHERE, TEXT_JUSTIFICATION_NONE); - if (j == line_limit_cache[line]) { - line++; - ofs = 0; - if (line >= max_text_lines) - break; - } - ofs += drawer.draw_char(get_canvas_item(), text_ofs + Vector2(ofs + (max_len - line_size_cache[line]) / 2, line * (font_height + line_separation)).floor(), items[i].text[j], items[i].text[j + 1], modulate); - } - - //special multiline mode } else { if (fixed_column_width > 0) diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index e3e9368a12ac..539f339d71e2 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -35,10 +35,13 @@ void Label::set_autowrap(bool p_autowrap) { - autowrap = p_autowrap; - word_cache_dirty = true; + if (autowrap != p_autowrap) { + autowrap = p_autowrap; + _lines_dirty = true; + } update(); } + bool Label::has_autowrap() const { return autowrap; @@ -46,10 +49,14 @@ bool Label::has_autowrap() const { void Label::set_uppercase(bool p_uppercase) { - uppercase = p_uppercase; - word_cache_dirty = true; + if (uppercase != p_uppercase) { + uppercase = p_uppercase; + s_paragraph->set_text((uppercase) ? xl_text.to_upper() : xl_text); + _lines_dirty = true; + } update(); } + bool Label::is_uppercase() const { return uppercase; @@ -57,7 +64,11 @@ bool Label::is_uppercase() const { int Label::get_line_height() const { - return get_font("font")->get_height(); + float total_h = 0.0; + for (int i = 0; i < s_lines.size(); i++) { + total_h += s_lines[i]->get_height(); + } + return MAX(get_font("font")->get_height(), total_h / s_lines.size()); } void Label::_notification(int p_what) { @@ -69,7 +80,9 @@ void Label::_notification(int p_what) { return; //nothing new xl_text = new_text; - regenerate_word_cache(); + s_paragraph->set_text(xl_text); + _reshape_lines(); + update(); } @@ -79,8 +92,8 @@ void Label::_notification(int p_what) { VisualServer::get_singleton()->canvas_item_set_clip(get_canvas_item(), true); } - if (word_cache_dirty) - regenerate_word_cache(); + if (_lines_dirty) + _reshape_lines(); RID ci = get_canvas_item(); @@ -99,23 +112,23 @@ void Label::_notification(int p_what) { VisualServer::get_singleton()->canvas_item_set_distance_field_mode(get_canvas_item(), font.is_valid() && font->is_distance_field_hint()); - int font_h = font->get_height() + line_spacing; - - int lines_visible = (size.y + line_spacing) / font_h; - - // ceiling to ensure autowrapping does not cut text - int space_w = Math::ceil(font->get_char_size(' ').width); - int chars_total = 0; - int vbegin = 0, vsep = 0; - if (lines_visible > line_count) { - lines_visible = line_count; + float total_h = 0.0; + int lines_visible = 0; + for (int i = lines_skipped; i < s_lines.size(); i++) { + total_h += s_lines[i]->get_height() + line_spacing; + if (total_h > (get_size().height - get_stylebox("normal")->get_minimum_size().height + line_spacing)) { + break; + } + lines_visible++; } - if (max_lines_visible >= 0 && lines_visible > max_lines_visible) { + if (lines_visible > s_lines.size()) + lines_visible = s_lines.size(); + + if (max_lines_visible >= 0 && lines_visible > max_lines_visible) lines_visible = max_lines_visible; - } if (lines_visible > 0) { @@ -125,19 +138,19 @@ void Label::_notification(int p_what) { //nothing } break; case VALIGN_CENTER: { - vbegin = (size.y - (lines_visible * font_h - line_spacing)) / 2; + vbegin = (size.y - (total_h - line_spacing)) / 2; vsep = 0; } break; case VALIGN_BOTTOM: { - vbegin = size.y - (lines_visible * font_h - line_spacing); + vbegin = size.y - (total_h - line_spacing); vsep = 0; } break; case VALIGN_FILL: { vbegin = 0; if (lines_visible > 1) { - vsep = (size.y - (lines_visible * font_h - line_spacing)) / (lines_visible - 1); + vsep = (size.y - (total_h - line_spacing)) / (lines_visible - 1); } else { vsep = 0; } @@ -146,148 +159,51 @@ void Label::_notification(int p_what) { } } - WordCache *wc = word_cache; - if (!wc) - return; - - int line = 0; - int line_to = lines_skipped + (lines_visible > 0 ? lines_visible : 1); - FontDrawer drawer(font, font_outline_modulate); - while (wc) { - /* handle lines not meant to be drawn quickly */ - if (line >= line_to) - break; - if (line < lines_skipped) { - - while (wc && wc->char_pos >= 0) - wc = wc->next; - if (wc) - wc = wc->next; - line++; - continue; - } - - /* handle lines normally */ - - if (wc->char_pos < 0) { - //empty line - wc = wc->next; - line++; - continue; - } - - WordCache *from = wc; - WordCache *to = wc; - - int taken = 0; - int spaces = 0; - while (to && to->char_pos >= 0) { - - taken += to->pixel_width; - if (to != from && to->space_count) { - spaces += to->space_count; - } - to = to->next; - } - - bool can_fill = to && to->char_pos == WordCache::CHAR_WRAPLINE; - - float x_ofs = 0; - + Vector2 ofs; + ofs.y = style->get_offset().y + vbegin; + for (int j = lines_skipped; j < s_lines.size(); j++) { + ofs.y += s_lines[j]->get_ascent(); switch (align) { - case ALIGN_FILL: case ALIGN_LEFT: { - x_ofs = style->get_offset().x; + ofs.x = style->get_offset().x; } break; case ALIGN_CENTER: { - x_ofs = int(size.width - (taken + spaces * space_w)) / 2; + ofs.x = int(size.width - s_lines[j]->get_width()) / 2; } break; case ALIGN_RIGHT: { - x_ofs = int(size.width - style->get_margin(MARGIN_RIGHT) - (taken + spaces * space_w)); + ofs.x = int(size.width - style->get_margin(MARGIN_RIGHT) - s_lines[j]->get_width()); } break; } - - float y_ofs = style->get_offset().y; - y_ofs += (line - lines_skipped) * font_h + font->get_ascent(); - y_ofs += vbegin + line * vsep; - - while (from != to) { - - // draw a word - int pos = from->char_pos; - if (from->char_pos < 0) { - - ERR_PRINT("BUG"); - return; + if (font_color_shadow.a > 0) { + s_lines[j]->draw(ci, ofs + shadow_ofs, font_color_shadow, false); + if (use_outline) { + //draw shadow + s_lines[j]->draw(ci, ofs + Vector2(-shadow_ofs.x, shadow_ofs.y), font_color_shadow, false); + s_lines[j]->draw(ci, ofs + Vector2(shadow_ofs.x, -shadow_ofs.y), font_color_shadow, false); + s_lines[j]->draw(ci, ofs + Vector2(-shadow_ofs.x, -shadow_ofs.y), font_color_shadow, false); } - if (from->space_count) { - /* spacing */ - x_ofs += space_w * from->space_count; - if (can_fill && align == ALIGN_FILL && spaces) { + } - x_ofs += int((size.width - (taken + space_w * spaces)) / spaces); - } - } + s_lines[j]->draw(ci, ofs, font->has_outline() ? font_outline_modulate : font_color, font->has_outline()); - if (font_color_shadow.a > 0) { - - int chars_total_shadow = chars_total; //save chars drawn - float x_ofs_shadow = x_ofs; - for (int i = 0; i < from->word_len; i++) { - - if (visible_chars < 0 || chars_total_shadow < visible_chars) { - CharType c = xl_text[i + pos]; - CharType n = xl_text[i + pos + 1]; - if (uppercase) { - c = String::char_uppercase(c); - n = String::char_uppercase(n); - } - - float move = font->draw_char(ci, Point2(x_ofs_shadow, y_ofs) + shadow_ofs, c, n, font_color_shadow, false); - if (use_outline) { - font->draw_char(ci, Point2(x_ofs_shadow, y_ofs) + Vector2(-shadow_ofs.x, shadow_ofs.y), c, n, font_color_shadow, false); - font->draw_char(ci, Point2(x_ofs_shadow, y_ofs) + Vector2(shadow_ofs.x, -shadow_ofs.y), c, n, font_color_shadow, false); - font->draw_char(ci, Point2(x_ofs_shadow, y_ofs) + Vector2(-shadow_ofs.x, -shadow_ofs.y), c, n, font_color_shadow, false); - } - x_ofs_shadow += move; - chars_total_shadow++; - } - } - } - for (int i = 0; i < from->word_len; i++) { - - if (visible_chars < 0 || chars_total < visible_chars) { - CharType c = xl_text[i + pos]; - CharType n = xl_text[i + pos + 1]; - if (uppercase) { - c = String::char_uppercase(c); - n = String::char_uppercase(n); - } - - x_ofs += drawer.draw_char(ci, Point2(x_ofs, y_ofs), c, n, font_color); - chars_total++; - } - } - from = from->next; + if (font->has_outline()) { + s_lines[j]->draw(ci, ofs, font_color, false); } - - wc = to ? to->next : 0; - line++; + ofs.y += s_lines[j]->get_descent() + vsep + line_spacing; } } - if (p_what == NOTIFICATION_THEME_CHANGED) { - word_cache_dirty = true; + _lines_dirty = true; update(); } if (p_what == NOTIFICATION_RESIZED) { - word_cache_dirty = true; + _lines_dirty = true; } } @@ -296,8 +212,8 @@ Size2 Label::get_minimum_size() const { Size2 min_style = get_stylebox("normal")->get_minimum_size(); // don't want to mutable everything - if (word_cache_dirty) - const_cast