Permalink
Browse files

[jsk_rviz_plugins] Rviz default font is changed from Arial to Liberat…

…ionSans (See: ros-visualization/rviz#1141)
  • Loading branch information...
orikuma committed Sep 15, 2017
1 parent 2c3a234 commit 69c456a5fc095a73b50cfd24fe7d7a605a5467cc
@@ -151,7 +151,7 @@ namespace jsk_rviz_plugins
scene_node_ = scene_manager_->getRootSceneNode()->createChildSceneNode();
orbit_node_ = scene_node_->createChildSceneNode(); // ??
line_ = new rviz::BillboardLine(context_->getSceneManager(), scene_node_);
msg_ = new rviz::MovableText("not initialized", "Arial", 0.05);
msg_ = new rviz::MovableText("not initialized", "Liberation Sans", 0.05);
msg_->setTextAlignment(rviz::MovableText::H_CENTER,
rviz::MovableText::V_ABOVE);
frame_id_property_->setFrameManager(context_->getFrameManager());
@@ -295,7 +295,7 @@ namespace jsk_rviz_plugins
context->getSceneManager(),
node_);
target_text_node_ = node_->createChildSceneNode();
msg_ = new rviz::MovableText("not initialized", "Arial", 0.05);
msg_ = new rviz::MovableText("not initialized", "Liberation Sans", 0.05);
msg_->setVisible(false);
msg_->setTextAlignment(rviz::MovableText::H_LEFT,
rviz::MovableText::V_ABOVE);
@@ -179,7 +179,7 @@ namespace jsk_rviz_plugins
// create nodes
Ogre::SceneNode* node = scene_node_->createChildSceneNode();
rviz::MovableText* text
= new rviz::MovableText("not initialized", "Arial", 0.05);
= new rviz::MovableText("not initialized", "Liberation Sans", 0.05);
text->setVisible(false);
text->setTextAlignment(rviz::MovableText::H_CENTER,
rviz::MovableText::V_ABOVE);
@@ -380,7 +380,7 @@ namespace jsk_rviz_plugins
{
painter.save();
const double r = size_ / 128.0;
QFont font("Arial", font_size * r, font_size * r, QFont::Bold);
QFont font("Liberation Sans", font_size * r, font_size * r, QFont::Bold);
QPen pen;
QPainterPath path;
pen.setWidth(1);
@@ -397,7 +397,7 @@ namespace jsk_rviz_plugins
{
painter.save();
const double r = size_ / 128.0;
QFont font("Arial", font_size * r, font_size * r, QFont::Bold);
QFont font("Liberation Sans", font_size * r, font_size * r, QFont::Bold);
QPen pen;
QPainterPath path;
pen.setWidth(1);
@@ -417,7 +417,7 @@ namespace jsk_rviz_plugins
const std::string text)
{
const double r = size_ / 128.0;
QFont font("Arial", font_size * r, font_size * r, false);
QFont font("Liberation Sans", font_size * r, font_size * r, false);
QPen pen;
QPainterPath path;
pen.setWidth(1);
@@ -598,7 +598,7 @@ namespace jsk_rviz_plugins
}
}
painter.setPen(QPen(textColor(), 2 * line_width, Qt::SolidLine));
painter.setFont(QFont("Arial", 12, QFont::Bold));
painter.setFont(QFont("Liberation Sans", 12, QFont::Bold));
double theta = atan2(S - B, S - A) / M_PI * 180;
double text_box_height = cos(theta*M_PI/180) * B;
double text_box_width = (S - A) / cos(theta*M_PI/180) - sin(theta*M_PI/180) * B * 2;
@@ -229,7 +229,7 @@ namespace jsk_rviz_plugins
// font
if (text_size_ != 0) {
//QFont font = painter.font();
QFont font(font_.length() > 0 ? font_.c_str(): "Arial");
QFont font(font_.length() > 0 ? font_.c_str(): "Liberation Sans");
font.setPointSize(text_size_);
font.setBold(true);
painter.setFont(font);
@@ -313,7 +313,7 @@ namespace jsk_rviz_plugins
pictogram_text);
painter.end();
}else if( mode_ == jsk_rviz_plugins::Pictogram::STRING_MODE){
QFont font("Arial");
QFont font("Liberation Sans");
font.setPointSize(32);
font.setBold(true);
painter.setFont(font);

0 comments on commit 69c456a

Please sign in to comment.