forked from H-uru/Plasma
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request H-uru#1489 from dgelessus/pltextfont_non_ascii
Support Unicode in `plTextFont` (avatar tooltips, console, etc.)
- Loading branch information
Showing
36 changed files
with
293 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,7 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
|
||
#include <algorithm> | ||
#include <string_theory/string> | ||
#include <utility> | ||
|
||
//#define MF_TOSSER | ||
|
||
|
@@ -2280,15 +2281,15 @@ void plDXPipeline::Resize( uint32_t width, uint32_t height ) | |
|
||
//// MakeTextFont ///////////////////////////////////////////////////////////// | ||
|
||
plTextFont *plDXPipeline::MakeTextFont( char *face, uint16_t size ) | ||
plTextFont* plDXPipeline::MakeTextFont(ST::string face, uint16_t size) | ||
{ | ||
plTextFont *font; | ||
|
||
|
||
font = new plDXTextFont( this, fD3DDevice ); | ||
if (font == nullptr) | ||
return nullptr; | ||
font->Create( face, size ); | ||
font->Create(std::move(face), size); | ||
font->Link( &fTextFontRefList ); | ||
|
||
return font; | ||
|
@@ -9811,9 +9812,8 @@ void plDXPlateManager::IDrawToDevice( plPipeline *pipe ) | |
{ | ||
dxPipe->IDrawPlate( plate ); | ||
|
||
const char *title = plate->GetTitle(); | ||
if( plDebugText::Instance().IsEnabled() && title[ 0 ] != 0 ) | ||
{ | ||
ST::string title = plate->GetTitle(); | ||
if (plDebugText::Instance().IsEnabled() && !title.empty()) { | ||
hsPoint3 pt; | ||
pt.Set( 0, -0.5, 0 ); | ||
pt = plate->GetTransform() * pt; | ||
|
@@ -9829,26 +9829,21 @@ void plDXPlateManager::IDrawToDevice( plPipeline *pipe ) | |
hsPoint3 pt, pt2; | ||
int i; | ||
|
||
if( graph->GetLabelText( 0 )[ 0 ] != 0 ) | ||
{ | ||
uint32_t numLabels = graph->GetNumLabels(); | ||
if (numLabels > 0) { | ||
/// Draw key | ||
const char *str; | ||
|
||
pt.Set( -0.5, -0.5, 0 ); | ||
pt = plate->GetTransform() * pt; | ||
pt.fX = pt.fX * scrnWidthDiv2 + scrnWidthDiv2; | ||
pt.fY = pt.fY * scrnHeightDiv2 + scrnHeightDiv2; | ||
pt.fY += plDebugText::Instance().GetFontHeight(); | ||
|
||
uint32_t numLabels = graph->GetNumLabels(); | ||
if (numLabels > graph->GetNumColors()) | ||
numLabels = graph->GetNumColors(); | ||
|
||
for( i = 0; i < numLabels; i++ ) | ||
{ | ||
str = graph->GetLabelText( i ); | ||
if( str[ 0 ] == 0 ) | ||
break; | ||
ST::string str = graph->GetLabelText(i); | ||
|
||
pt2 = pt; | ||
pt2.fX -= plDebugText::Instance().CalcStringWidth( str ); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,8 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
#include "HeadSpin.h" | ||
#include "hsWindows.h" | ||
|
||
#include <string_theory/string> | ||
|
||
#include "plPipeline/hsWinRef.h" | ||
|
||
#include "plGLPipeline.h" | ||
|
@@ -79,7 +81,7 @@ bool plGLPipeline::PrepForRender(plDrawable* drawable, std::vector<int16_t>& vis | |
void plGLPipeline::Render(plDrawable* d, const std::vector<int16_t>& visList) | ||
{} | ||
|
||
plTextFont* plGLPipeline::MakeTextFont(char* face, uint16_t size) | ||
plTextFont* plGLPipeline::MakeTextFont(ST::string face, uint16_t size) | ||
{ | ||
return nullptr; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.