@@ -183,8 +183,7 @@ void TextAnnotation::parseShapeAnnotation(QString annotation)
183183 mFontSize = list.at (10 ).toFloat ();
184184 // 12th item of the list contains the optional textColor, {-1, -1, -1} if not set
185185 QStringList textColorList = StringHandler::getStrings (StringHandler::removeFirstLastCurlBrackets (list.at (11 )));
186- if (textColorList.size () >= 3 )
187- {
186+ if (textColorList.size () >= 3 ) {
188187 int red, green, blue = 0 ;
189188 red = textColorList.at (0 ).toInt ();
190189 green = textColorList.at (1 ).toInt ();
@@ -418,24 +417,30 @@ QString TextAnnotation::getOMCShapeAnnotation()
418417 annotationString.append (QString (" \" " ).append (mOriginalTextString ).append (" \" " ));
419418 // get the font size
420419 annotationString.append (QString::number (mFontSize ));
420+ // get the text color
421+ QString textColorString;
422+ textColorString.append (" {" );
423+ textColorString.append (QString::number (mLineColor .red ())).append (" ," );
424+ textColorString.append (QString::number (mLineColor .green ())).append (" ," );
425+ textColorString.append (QString::number (mLineColor .blue ()));
426+ textColorString.append (" }" );
427+ annotationString.append (textColorString);
421428 // get the font name
422- if (!mFontName .isEmpty ()) {
429+ if (!mFontName .isEmpty () && mFontName . compare (Helper::systemFontInfo. family ()) != 0 ) {
423430 annotationString.append (QString (" \" " ).append (mFontName ).append (" \" " ));
431+ } else {
432+ annotationString.append (QString (" \"\" " ));
424433 }
425434 // get the font styles
426435 QString textStylesString;
427436 QStringList stylesList;
428- if (mTextStyles .size () > 0 ) {
429- textStylesString.append (" {" );
430- }
437+ textStylesString.append (" {" );
431438 for (int i = 0 ; i < mTextStyles .size () ; i++) {
432439 stylesList.append (StringHandler::getTextStyleString (mTextStyles [i]));
433440 }
434- if (mTextStyles .size () > 0 ) {
435- textStylesString.append (stylesList.join (" ," ));
436- textStylesString.append (" }" );
437- annotationString.append (textStylesString);
438- }
441+ textStylesString.append (stylesList.join (" ," ));
442+ textStylesString.append (" }" );
443+ annotationString.append (textStylesString);
439444 // get the font horizontal alignment
440445 annotationString.append (StringHandler::getTextAlignmentString (mHorizontalAlignment ));
441446 return annotationString.join (" ," );
0 commit comments