Permalink
Browse files

fixes for symbols in text

  • Loading branch information...
1 parent df58146 commit 78475df5e02beebe34681cd84f8fdbe52873b03f @wschweer wschweer committed Feb 21, 2014
Showing with 194,738 additions and 216,578 deletions.
  1. +281 −287 fonts/mscore/mscore.sfd
  2. BIN fonts/mscore/mscore.ttf
  3. +1 −1 libmscore/style.cpp
  4. +8 −8 libmscore/tempotext.h
  5. +43 −19 libmscore/text.cpp
  6. +3 −2 libmscore/text.h
  7. +2 −0 mscore/texttools.cpp
  8. +4,810 −5,266 share/locale/mscore_af.ts
  9. +4,189 −4,648 share/locale/mscore_ar.ts
  10. +4,132 −4,591 share/locale/mscore_ast.ts
  11. +4,551 −5,007 share/locale/mscore_be.ts
  12. +4,138 −4,597 share/locale/mscore_bg.ts
  13. +4,115 −4,574 share/locale/mscore_ca.ts
  14. +2,345 −2,804 share/locale/mscore_cs.ts
  15. +4,116 −4,575 share/locale/mscore_da.ts
  16. +2,338 −2,797 share/locale/mscore_de.ts
  17. +2,830 −3,287 share/locale/mscore_el.ts
  18. +2,360 −2,819 share/locale/mscore_en_GB.ts
  19. +4,845 −5,301 share/locale/mscore_en_US.ts
  20. +4,127 −4,586 share/locale/mscore_eo.ts
  21. +2,360 −2,819 share/locale/mscore_es.ts
  22. +4,262 −4,721 share/locale/mscore_et.ts
  23. +4,141 −4,600 share/locale/mscore_eu.ts
  24. +4,132 −4,591 share/locale/mscore_fa.ts
  25. +4,116 −4,575 share/locale/mscore_fi.ts
  26. +4,132 −4,591 share/locale/mscore_fo.ts
  27. +3,868 −4,327 share/locale/mscore_fr.ts
  28. +2,995 −3,451 share/locale/mscore_gl.ts
  29. +4,323 −4,779 share/locale/mscore_he.ts
  30. +4,814 −5,270 share/locale/mscore_hi_IN.ts
  31. +4,126 −4,585 share/locale/mscore_hr.ts
  32. +4,117 −4,576 share/locale/mscore_hu.ts
  33. +4,812 −5,268 share/locale/mscore_id.ts
  34. +4,062 −4,521 share/locale/mscore_it.ts
  35. +3,873 −4,323 share/locale/mscore_ja.ts
  36. +4,078 −4,537 share/locale/mscore_ko.ts
  37. +4,121 −4,580 share/locale/mscore_lt.ts
  38. +4,595 −5,051 share/locale/mscore_mn_MN.ts
  39. +4,115 −4,574 share/locale/mscore_nb.ts
  40. +4,075 −4,534 share/locale/mscore_nl.ts
  41. +2,347 −2,806 share/locale/mscore_pl.ts
  42. +4,224 −4,683 share/locale/mscore_pt.ts
  43. +4,116 −4,575 share/locale/mscore_pt_BR.ts
  44. +4,132 −4,591 share/locale/mscore_ro.ts
  45. +4,061 −4,520 share/locale/mscore_ru.ts
  46. +4,117 −4,576 share/locale/mscore_sk.ts
  47. +4,147 −4,606 share/locale/mscore_sl.ts
  48. +3,521 −3,980 share/locale/mscore_sr.ts
  49. +4,116 −4,575 share/locale/mscore_sv.ts
  50. +4,425 −4,881 share/locale/mscore_th.ts
  51. +4,415 −4,871 share/locale/mscore_tr.ts
  52. +4,156 −4,615 share/locale/mscore_uk.ts
  53. +4,286 −4,156 share/locale/mscore_uz@Latn.ts
  54. +4,117 −4,576 share/locale/mscore_vi.ts
  55. +4,046 −4,505 share/locale/mscore_zh_CN.ts
  56. +4,161 −4,620 share/locale/mscore_zh_TW.ts
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
Binary file not shown.
View
@@ -288,7 +288,7 @@ void initStyle(MStyle* s)
ALIGN_LEFT | ALIGN_TOP, QPointF(), OA, QPointF()));
AS(TextStyle(
- TR( "Dynamics"), ff, 12, false,
+ TR( "Dynamics"), ff, 20, false,
false, // italic?
false,
ALIGN_HCENTER | ALIGN_BASELINE, QPointF(0.0, 8.0), OS, QPointF(), true));
View
@@ -35,10 +35,10 @@ class TempoText : public Text {
public:
TempoText(Score*);
- virtual TempoText* clone() const { return new TempoText(*this); }
- virtual ElementType type() const { return TEMPO_TEXT; }
- virtual void write(Xml& xml) const;
- virtual void read(XmlReader&);
+ virtual TempoText* clone() const override { return new TempoText(*this); }
+ virtual ElementType type() const override { return TEMPO_TEXT; }
+ virtual void write(Xml& xml) const override;
+ virtual void read(XmlReader&) override;
Segment* segment() const { return (Segment*)parent(); }
Measure* measure() const { return (Measure*)parent()->parent(); }
@@ -50,12 +50,12 @@ class TempoText : public Text {
void setFollowText(bool v) { _followText = v; }
void undoSetFollowText(bool v);
- virtual void textChanged();
+ virtual void textChanged() override;
virtual void layout();
- QVariant getProperty(P_ID propertyId) const;
- bool setProperty(P_ID propertyId, const QVariant&);
- QVariant propertyDefault(P_ID id) const;
+ QVariant getProperty(P_ID propertyId) const override;
+ bool setProperty(P_ID propertyId, const QVariant&) override;
+ QVariant propertyDefault(P_ID id) const override;
};
View
@@ -33,14 +33,17 @@ TextCursor Text::_cursor;
bool CharFormat::operator==(const CharFormat& cf) const
{
- return
- cf.type() == type()
- && cf.bold() == bold()
- && cf.italic() == italic()
- && cf.underline() == underline()
- && cf.valign() == valign()
- && cf.fontSize() == fontSize()
- && cf.fontFamily() == fontFamily();
+ if (cf.type() != type())
+ return false;
+ if (cf.bold() != bold()
+ || cf.italic() != italic()
+ || cf.underline() != underline()
+ || cf.valign() != valign()
+ || cf.fontSize() != fontSize())
+ return false;
+ if (type() == CharFormatType::TEXT)
+ return cf.fontFamily() == fontFamily();
+ return true;
}
//---------------------------------------------------------
@@ -163,13 +166,12 @@ QFont TextFragment::font(const Text* t) const
qreal m = format.fontSize() * MScore::DPI / PPI;
if (t->textStyle().sizeIsSpatiumDependent())
m *= t->spatium() / ( SPATIUM20 * MScore::DPI);
+
+ font.setUnderline(format.underline());
if (format.type() == CharFormatType::TEXT) {
font.setFamily(format.fontFamily());
font.setBold(format.bold());
font.setItalic(format.italic());
- font.setUnderline(format.underline());
- if (format.valign() != VerticalAlignment::AlignNormal)
- m *= subScriptSize;
}
else {
bool fallback = false;
@@ -187,9 +189,11 @@ QFont TextFragment::font(const Text* t) const
font.setWeight(QFont::Normal); // if not set we get system default
font.setStyleStrategy(QFont::NoFontMerging);
font.setHintingPreference(QFont::PreferVerticalHinting);
- if (f->family() == "Bravura") // HACK: why are bravura dynamics are so small?
- m *= 1.9;
+ // if (f->family() == "Bravura") // HACK: why are bravura dynamics are so small?
+ // m *= 1.9;
}
+ if (format.valign() != VerticalAlignment::AlignNormal)
+ m *= subScriptSize;
font.setPixelSize(lrint(m));
return font;
}
@@ -438,11 +442,22 @@ void TextBlock::insert(TextCursor* cursor, SymId id)
int rcol;
auto i = fragment(cursor->column(), &rcol);
if (i != _text.end()) {
- if (i->format.type() == CharFormatType::SYMBOL)
- i->ids.insert(rcol, id);
+ if (i->format.type() == CharFormatType::SYMBOL) {
+ if (!(i->format == *cursor->format())) {
+ if (rcol == 0)
+ _text.insert(i, TextFragment(cursor, id));
+ else {
+ TextFragment f2 = i->split(rcol);
+ i = _text.insert(i+1, TextFragment(cursor, id));
+ _text.insert(i+1, f2);
+ }
+ }
+ else
+ i->ids.insert(rcol, id);
+ }
else if (i->format.type() == CharFormatType::TEXT) {
if (rcol == 0) {
- if (i != _text.begin() && (i-1)->format.type() == CharFormatType::SYMBOL)
+ if (i != _text.begin() && (i-1)->format == *cursor->format())
(i-1)->ids.append(id);
else
_text.insert(i, TextFragment(cursor, id));
@@ -1134,9 +1149,8 @@ void Text::startEdit(MuseScoreView*, const QPointF& pt)
layout();
if (setCursor(pt))
updateCursorFormat(&_cursor);
- else {
+ else
_cursor.initFromStyle(textStyle());
- }
undoPushProperty(P_TEXT);
}
@@ -1293,6 +1307,7 @@ void Text::endEdit()
e->undoChangeProperty(P_TEXT, _text);
}
}
+ textChanged();
}
//---------------------------------------------------------
@@ -2070,8 +2085,17 @@ Element* Text::drop(const DropData& data)
void Text::setPlainText(const QString& s)
{
- _text = s.toHtmlEscaped();
+ setText(s.toHtmlEscaped());
}
+//---------------------------------------------------------
+// setText
+//---------------------------------------------------------
+
+void Text::setText(const QString& s)
+ {
+ _text = s;
+ textChanged();
+ }
}
View
@@ -216,8 +216,8 @@ class Text : public Element {
const TextStyle& textStyle() const { return _textStyle; }
TextStyle& textStyle() { return _textStyle; }
- void setPlainText(const QString& s);
- void setText(const QString& s) { _text = s; }
+ void setPlainText(const QString&);
+ void setText(const QString&);
QString text() const { return _text; }
void insertText(const QString&);
@@ -288,6 +288,7 @@ class Text : public Element {
friend class TextBlock;
friend class TextFragment;
+ virtual void textChanged() {}
};
View
@@ -144,6 +144,7 @@ TextTools::TextTools(QWidget* parent)
tb->addWidget(typefaceFamily);
typefaceSize = new QDoubleSpinBox(this);
+ typefaceSize->setFocusPolicy(Qt::ClickFocus);
tb->addWidget(typefaceSize);
setWidget(tb);
@@ -250,6 +251,7 @@ void TextTools::updateTools()
QFont f(format->fontFamily());
typefaceFamily->setCurrentFont(f);
+ typefaceFamily->setEnabled(cursor->format()->type() == CharFormatType::TEXT);
typefaceSize->setValue(format->fontSize());
typefaceItalic->setChecked(format->italic());
Oops, something went wrong.

0 comments on commit 78475df

Please sign in to comment.