Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[Qt] Do not install/link with ICU if WITH_QT_I18N is set - #7386

Merged
brunoabinader merged 3 commits into
masterfrom
qt-no-icu
Dec 12, 2016
Merged

brunoabinader merged 3 commits into
masterfrom
qt-no-icu

Conversation

@brunoabinader

Copy link
Copy Markdown
Contributor

As part of the arrangements for getting Mapbox GL native as a 3rd party submodule in Qt framework, we are optionally removing ICU support via WITH_QT_I18N compile flag.

This PR:

  • Moves bidi.cpp default implementation to platform/default/bidi.cpp - all platforms explicitly compiles it by default as part of mbgl-core target.
  • Added BiDiImpl to hide ICU data types from BiDi interface.
  • Provide a Qt-only line breaking implementation via platform/qt/src/bidi.cpp - arabic shaping is not supported atm.

@brunoabinader brunoabinader added build Qt Mapbox Maps SDK for Qt, aka Qt Location Mapbox GL labels Dec 12, 2016
@mention-bot

Copy link
Copy Markdown

@brunoabinader, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @tmpsantos and @1ec5 to be potential reviewers.

Comment thread platform/qt/src/bidi.cpp Outdated
}

void ProcessedBiDiText::mergeParagraphLineBreaks(std::set<int32_t>& lineBreakPoints) {
QTextBoundaryFinder finder(QTextBoundaryFinder::Line, bidi.impl->string);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the documentation for QTextBoundaryFinder::Line ("Finds possible positions for breaking the text into multiple lines."), it seems like this will insert a line break everywhere a line break is possible? Although maybe I'm misreading, because I expect that would have broken some tests...

The intention of this method is only to insert line breaks where the ICU BiDi algorithm absolutely requires them (for "block separators"), in case the calling code for whatever reason decided not to explicitly break at one of them. The common block separator is "\n", but there are more exotic ones like U+001C "INFORMATION SEPARATOR FOUR". For stubbing this code out on Qt, I don't think we need to implement any of this behavior (beyond maybe what's necessary to pass tests).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - we can maybe revisit it once we get unit tests to verify.

@ChrisLoer ChrisLoer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

build Qt Mapbox Maps SDK for Qt, aka Qt Location Mapbox GL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants