fix: fix corner annotation chinese text render bug
This commit is contained in:
@@ -9,7 +9,9 @@
|
||||
#include <vtkCoordinate.h>
|
||||
|
||||
vtkStandardNewMacro(FastCornerAnnotationActor);
|
||||
|
||||
namespace{
|
||||
const char* FONT_FILE_PATH = "C:/Windows/Fonts/simhei.ttf";
|
||||
}
|
||||
FastCornerAnnotationActor::FastCornerAnnotationActor()
|
||||
: vtkProp(){
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
@@ -17,8 +19,8 @@ FastCornerAnnotationActor::FastCornerAnnotationActor()
|
||||
Actors[i]->Register(this);
|
||||
Actors[i]->SetTextScaleModeToNone();
|
||||
Actors[i]->SetUseBorderAlign(true);
|
||||
Actors[i]->GetTextProperty()->SetFontFamilyToCourier();
|
||||
Actors[i]->GetTextProperty()->SetFontSize(6);
|
||||
Actors[i]->GetTextProperty()->SetFontFamily(VTK_FONT_FILE);
|
||||
Actors[i]->GetTextProperty()->SetFontFile(FONT_FILE_PATH);
|
||||
Actors[i]->GetTextProperty()->BoldOn();
|
||||
Actors[i]->GetTextProperty()->ShadowOn();
|
||||
Actors[i]->GetActualPositionCoordinate()->SetCoordinateSystemToDisplay();
|
||||
|
||||
Reference in New Issue
Block a user