Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YGOPRO-520DIY
ygopro
Commits
75bd5ab6
Commit
75bd5ab6
authored
Oct 19, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CGUITTFont: use override
parent
20795dd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
28 deletions
+28
-28
gframe/CGUITTFont.h
gframe/CGUITTFont.h
+28
-28
No files found.
gframe/CGUITTFont.h
View file @
75bd5ab6
...
...
@@ -54,7 +54,7 @@ public:
//! Structure representing a single TrueType glyph.
struct
SGUITTGlyph
{
//! Constructor.
SGUITTGlyph
()
:
isLoaded
(
false
),
glyph_page
(
0
),
surface
(
0
),
parent
(
0
)
{}
SGUITTGlyph
()
:
isLoaded
(
false
),
glyph_page
(
0
),
advance
({}),
surface
(
0
),
parent
(
0
)
{}
//! Destructor.
~
SGUITTGlyph
()
{
...
...
@@ -207,60 +207,60 @@ public:
static
CGUITTFont
*
create
(
IrrlichtDevice
*
device
,
const
io
::
path
&
filename
,
const
u32
size
,
const
bool
antialias
=
true
,
const
bool
transparency
=
true
);
//! Destructor
virtual
~
CGUITTFont
()
;
~
CGUITTFont
()
override
;
//! Sets the amount of glyphs to batch load.
v
irtual
v
oid
setBatchLoadSize
(
u32
batch_size
)
{
void
setBatchLoadSize
(
u32
batch_size
)
{
batch_load_size
=
batch_size
;
}
//! Sets the maximum texture size for a page of glyphs.
v
irtual
v
oid
setMaxPageTextureSize
(
const
core
::
dimension2du
&
texture_size
)
{
void
setMaxPageTextureSize
(
const
core
::
dimension2du
&
texture_size
)
{
max_page_texture_size
=
texture_size
;
}
//! Get the font size.
virtual
u32
getFontSize
()
const
{
u32
getFontSize
()
const
{
return
size
;
}
//! Check the font's transparency.
virtual
bool
isTransparent
()
const
{
bool
isTransparent
()
const
{
return
use_transparency
;
}
//! Check if the font auto-hinting is enabled.
//! Auto-hinting is FreeType's built-in font hinting engine.
virtual
bool
useAutoHinting
()
const
{
bool
useAutoHinting
()
const
{
return
use_auto_hinting
;
}
//! Check if the font hinting is enabled.
virtual
bool
useHinting
()
const
{
bool
useHinting
()
const
{
return
use_hinting
;
}
//! Check if the font is being loaded as a monochrome font.
//! The font can either be a 256 color grayscale font, or a 2 color monochrome font.
virtual
bool
useMonochrome
()
const
{
bool
useMonochrome
()
const
{
return
use_monochrome
;
}
//! Tells the font to allow transparency when rendering.
//! Default: true.
//! \param flag If true, the font draws using transparency.
v
irtual
v
oid
setTransparency
(
const
bool
flag
);
void
setTransparency
(
const
bool
flag
);
//! Tells the font to use monochrome rendering.
//! Default: false.
//! \param flag If true, the font draws using a monochrome image. If false, the font uses a grayscale image.
v
irtual
v
oid
setMonochrome
(
const
bool
flag
);
void
setMonochrome
(
const
bool
flag
);
//! Enables or disables font hinting.
//! Default: Hinting and auto-hinting true.
//! \param enable If false, font hinting is turned off. If true, font hinting is turned on.
//! \param enable_auto_hinting If true, FreeType uses its own auto-hinting algorithm. If false, it tries to use the algorithm specified by the font.
v
irtual
v
oid
setFontHinting
(
const
bool
enable
,
const
bool
enable_auto_hinting
=
true
);
void
setFontHinting
(
const
bool
enable
,
const
bool
enable_auto_hinting
=
true
);
//! Draws some text and clips it to the specified rectangle if wanted.
void
draw
(
const
core
::
stringw
&
text
,
const
core
::
rect
<
s32
>&
position
,
...
...
@@ -271,32 +271,32 @@ public:
const
core
::
rect
<
s32
>*
clip
=
0
);
//! Returns the dimension of a character produced by this font.
virtual
core
::
dimension2d
<
u32
>
getCharDimension
(
const
wchar_t
ch
)
const
;
core
::
dimension2d
<
u32
>
getCharDimension
(
const
wchar_t
ch
)
const
;
//! Returns the dimension of a text string.
virtual
core
::
dimension2d
<
u32
>
getDimension
(
const
wchar_t
*
text
)
const
;
virtual
core
::
dimension2d
<
u32
>
getDimension
(
const
core
::
ustring
&
text
)
const
;
core
::
dimension2d
<
u32
>
getDimension
(
const
wchar_t
*
text
)
const
override
;
core
::
dimension2d
<
u32
>
getDimension
(
const
core
::
ustring
&
text
)
const
;
//! Calculates the index of the character in the text which is on a specific position.
virtual
s32
getCharacterFromPos
(
const
wchar_t
*
text
,
s32
pixel_x
)
const
;
virtual
s32
getCharacterFromPos
(
const
core
::
ustring
&
text
,
s32
pixel_x
)
const
;
s32
getCharacterFromPos
(
const
wchar_t
*
text
,
s32
pixel_x
)
const
override
;
s32
getCharacterFromPos
(
const
core
::
ustring
&
text
,
s32
pixel_x
)
const
;
//! Sets global kerning width for the font.
v
irtual
void
setKerningWidth
(
s32
kerning
)
;
v
oid
setKerningWidth
(
s32
kerning
)
override
;
//! Sets global kerning height for the font.
v
irtual
void
setKerningHeight
(
s32
kerning
)
;
v
oid
setKerningHeight
(
s32
kerning
)
override
;
//! Gets kerning values (distance between letters) for the font. If no parameters are provided,
virtual
s32
getKerningWidth
(
const
wchar_t
*
thisLetter
=
0
,
const
wchar_t
*
previousLetter
=
0
)
const
;
virtual
s32
getKerningWidth
(
const
uchar32_t
thisLetter
=
0
,
const
uchar32_t
previousLetter
=
0
)
const
;
s32
getKerningWidth
(
const
wchar_t
*
thisLetter
=
0
,
const
wchar_t
*
previousLetter
=
0
)
const
override
;
s32
getKerningWidth
(
const
uchar32_t
thisLetter
=
0
,
const
uchar32_t
previousLetter
=
0
)
const
;
//! Returns the distance between letters
virtual
s32
getKerningHeight
()
const
;
s32
getKerningHeight
()
const
override
;
//! Define which characters should not be drawn by the font.
v
irtual
void
setInvisibleCharacters
(
const
wchar_t
*
s
)
;
v
irtual
v
oid
setInvisibleCharacters
(
const
core
::
ustring
&
s
);
v
oid
setInvisibleCharacters
(
const
wchar_t
*
s
)
override
;
void
setInvisibleCharacters
(
const
core
::
ustring
&
s
);
//! Get the last glyph page if there's still available slots.
//! If not, it will return zero.
...
...
@@ -315,14 +315,14 @@ public:
//! Create corresponding character's software image copy from the font,
//! so you can use this data just like any ordinary video::IImage.
//! \param ch The character you need
vi
rtual
vi
deo
::
IImage
*
createTextureFromChar
(
const
uchar32_t
&
ch
);
video
::
IImage
*
createTextureFromChar
(
const
uchar32_t
&
ch
);
//! This function is for debugging mostly. If the page doesn't exist it returns zero.
//! \param page_index Simply return the texture handle of a given page index.
vi
rtual
vi
deo
::
ITexture
*
getPageTextureByIndex
(
const
u32
&
page_index
)
const
;
video
::
ITexture
*
getPageTextureByIndex
(
const
u32
&
page_index
)
const
;
//! Add a list of scene nodes generated by putting font textures on the 3D planes.
virtual
core
::
array
<
scene
::
ISceneNode
*>
addTextSceneNode
core
::
array
<
scene
::
ISceneNode
*>
addTextSceneNode
(
const
wchar_t
*
text
,
scene
::
ISceneManager
*
smgr
,
scene
::
ISceneNode
*
parent
=
0
,
const
video
::
SColor
&
color
=
video
::
SColor
(
255
,
0
,
0
,
0
),
bool
center
=
false
);
...
...
@@ -343,7 +343,7 @@ private:
static
scene
::
IMesh
*
shared_plane_ptr_
;
static
scene
::
SMesh
shared_plane_
;
CGUITTFont
(
IGUIEnvironment
*
env
);
explicit
CGUITTFont
(
IGUIEnvironment
*
env
);
bool
load
(
const
io
::
path
&
filename
,
const
u32
size
,
const
bool
antialias
,
const
bool
transparency
);
void
reset_images
();
void
update_glyph_pages
()
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment