[TD]fix Text sizes not exact
This commit is contained in:
committed by
WandererFan
parent
8b4e114b9d
commit
71426aa467
@@ -127,14 +127,14 @@ void QGIViewAnnotation::drawAnnotation()
|
||||
}
|
||||
|
||||
const std::vector<std::string>& annoText = viewAnno->Text.getValues();
|
||||
int fontSize = calculateFontPixelSize(viewAnno->TextSize.getValue());
|
||||
int scaledSize = exactFontSize(viewAnno->Font.getValue(), viewAnno->TextSize.getValue());
|
||||
|
||||
//build HTML/CSS formatting around Text lines
|
||||
std::stringstream ss;
|
||||
ss << "<html>\n<head>\n<style>\n";
|
||||
ss << "p {";
|
||||
ss << "font-family:" << viewAnno->Font.getValue() << "; ";
|
||||
ss << "font-size:" << fontSize << "px; ";
|
||||
ss << "font-size:" << scaledSize << "px; ";
|
||||
if (viewAnno->TextStyle.isValue("Normal")) {
|
||||
ss << "font-weight:normal; font-style:normal; ";
|
||||
} else if (viewAnno->TextStyle.isValue("Bold")) {
|
||||
@@ -160,7 +160,7 @@ void QGIViewAnnotation::drawAnnotation()
|
||||
std::string lt = std::regex_replace((*it), std::regex("<"), "<");
|
||||
ss << lt;
|
||||
}
|
||||
ss << "<br></p>\n</body>\n</html> ";
|
||||
ss << "</p>\n</body>\n</html> ";
|
||||
|
||||
prepareGeometryChange();
|
||||
m_textItem->setTextWidth(Rez::guiX(viewAnno->MaxWidth.getValue()));
|
||||
|
||||
Reference in New Issue
Block a user