mirror of https://github.com/procxx/kepka.git
fixed Semibold font in Qt 5.4.0 fontconfig, fixed youtu.be with #
This commit is contained in:
parent
0a5e1a69e3
commit
394170bd4c
|
@ -3340,7 +3340,7 @@ void HistoryContact::updateFrom(const MTPMessageMedia &media) {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
QRegularExpression reYouTube1(qsl("^(https?://)?(www\\.|m\\.)?youtube\\.com/watch\\?([^#]+&)?v=([a-z0-9_-]+)(&[^\\s]*)?$"), QRegularExpression::CaseInsensitiveOption);
|
QRegularExpression reYouTube1(qsl("^(https?://)?(www\\.|m\\.)?youtube\\.com/watch\\?([^#]+&)?v=([a-z0-9_-]+)(&[^\\s]*)?$"), QRegularExpression::CaseInsensitiveOption);
|
||||||
QRegularExpression reYouTube2(qsl("^(https?://)?(www\\.)?youtu\\.be/([a-z0-9_-]+)([/\\?][^\\s]*)?$"), QRegularExpression::CaseInsensitiveOption);
|
QRegularExpression reYouTube2(qsl("^(https?://)?(www\\.)?youtu\\.be/([a-z0-9_-]+)([/\\?#][^\\s]*)?$"), QRegularExpression::CaseInsensitiveOption);
|
||||||
QRegularExpression reInstagram(qsl("^(https?://)?(www\\.)?instagram\\.com/p/([a-z0-9_-]+)([/\\?][^\\s]*)?$"), QRegularExpression::CaseInsensitiveOption);
|
QRegularExpression reInstagram(qsl("^(https?://)?(www\\.)?instagram\\.com/p/([a-z0-9_-]+)([/\\?][^\\s]*)?$"), QRegularExpression::CaseInsensitiveOption);
|
||||||
QRegularExpression reVimeo(qsl("^(https?://)?(www\\.)?vimeo\\.com/([0-9]+)([/\\?][^\\s]*)?$"), QRegularExpression::CaseInsensitiveOption);
|
QRegularExpression reVimeo(qsl("^(https?://)?(www\\.)?vimeo\\.com/([0-9]+)([/\\?][^\\s]*)?$"), QRegularExpression::CaseInsensitiveOption);
|
||||||
|
|
||||||
|
|
|
@ -341,6 +341,15 @@ static void populateFromPattern(FcPattern *pattern)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
familyName = QString::fromUtf8((const char *)value);
|
familyName = QString::fromUtf8((const char *)value);
|
||||||
|
if (familyName == QLatin1String("Open Sans")) {
|
||||||
|
FcChar8 *styl = 0;
|
||||||
|
if (FcPatternGetString(pattern, FC_STYLE, 0, &styl) == FcResultMatch) {
|
||||||
|
QString style = QString::fromUtf8(reinterpret_cast<const char *>(styl));
|
||||||
|
if (style == QLatin1String("Semibold")) {
|
||||||
|
familyName.append(QChar(QChar::Space)).append(style);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
slant_value = FC_SLANT_ROMAN;
|
slant_value = FC_SLANT_ROMAN;
|
||||||
weight_value = FC_WEIGHT_REGULAR;
|
weight_value = FC_WEIGHT_REGULAR;
|
||||||
|
@ -778,6 +787,15 @@ QStringList QFontconfigDatabase::addApplicationFont(const QByteArray &fontData,
|
||||||
FcChar8 *fam = 0;
|
FcChar8 *fam = 0;
|
||||||
if (FcPatternGetString(pattern, FC_FAMILY, 0, &fam) == FcResultMatch) {
|
if (FcPatternGetString(pattern, FC_FAMILY, 0, &fam) == FcResultMatch) {
|
||||||
QString family = QString::fromUtf8(reinterpret_cast<const char *>(fam));
|
QString family = QString::fromUtf8(reinterpret_cast<const char *>(fam));
|
||||||
|
if (family == QLatin1String("Open Sans")) {
|
||||||
|
FcChar8 *styl = 0;
|
||||||
|
if (FcPatternGetString(pattern, FC_STYLE, 0, &styl) == FcResultMatch) {
|
||||||
|
QString style = QString::fromUtf8(reinterpret_cast<const char *>(styl));
|
||||||
|
if (style == QLatin1String("Semibold")) {
|
||||||
|
family.append(QChar(QChar::Space)).append(style);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
families << family;
|
families << family;
|
||||||
}
|
}
|
||||||
populateFromPattern(pattern);
|
populateFromPattern(pattern);
|
||||||
|
|
Loading…
Reference in New Issue