Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
c10dab13
Unverified
Commit
c10dab13
authored
May 27, 2020
by
Rémi Verschelde
Committed by
GitHub
May 27, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #39079 from mrushyendra/exposeGetCharSize
Expose `get_char_size()` from Font instead of BitmapFont
parents
a5a7f5f7
a4413710
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
13 deletions
+12
-13
BitmapFont.xml
doc/classes/BitmapFont.xml
+0
-11
Font.xml
doc/classes/Font.xml
+11
-0
font.cpp
scene/resources/font.cpp
+1
-2
No files found.
doc/classes/BitmapFont.xml
View file @
c10dab13
...
...
@@ -65,17 +65,6 @@
Creates a BitmapFont from the [code]*.fnt[/code] file at [code]path[/code].
</description>
</method>
<method
name=
"get_char_size"
qualifiers=
"const"
>
<return
type=
"Vector2"
>
</return>
<argument
index=
"0"
name=
"char"
type=
"int"
>
</argument>
<argument
index=
"1"
name=
"next"
type=
"int"
default=
"0"
>
</argument>
<description>
Returns the size of a character, optionally taking kerning into account if the next character is provided.
</description>
</method>
<method
name=
"get_kerning_pair"
qualifiers=
"const"
>
<return
type=
"int"
>
</return>
...
...
doc/classes/Font.xml
View file @
c10dab13
...
...
@@ -54,6 +54,17 @@
Returns the font ascent (number of pixels above the baseline).
</description>
</method>
<method
name=
"get_char_size"
qualifiers=
"const"
>
<return
type=
"Vector2"
>
</return>
<argument
index=
"0"
name=
"char"
type=
"int"
>
</argument>
<argument
index=
"1"
name=
"next"
type=
"int"
default=
"0"
>
</argument>
<description>
Returns the size of a character, optionally taking kerning into account if the next character is provided.
</description>
</method>
<method
name=
"get_descent"
qualifiers=
"const"
>
<return
type=
"float"
>
</return>
...
...
scene/resources/font.cpp
View file @
c10dab13
...
...
@@ -93,6 +93,7 @@ void Font::_bind_methods() {
ClassDB
::
bind_method
(
D_METHOD
(
"get_descent"
),
&
Font
::
get_descent
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_height"
),
&
Font
::
get_height
);
ClassDB
::
bind_method
(
D_METHOD
(
"is_distance_field_hint"
),
&
Font
::
is_distance_field_hint
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_char_size"
,
"char"
,
"next"
),
&
Font
::
get_char_size
,
DEFVAL
(
0
));
ClassDB
::
bind_method
(
D_METHOD
(
"get_string_size"
,
"string"
),
&
Font
::
get_string_size
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_wordwrap_string_size"
,
"string"
,
"width"
),
&
Font
::
get_wordwrap_string_size
);
ClassDB
::
bind_method
(
D_METHOD
(
"has_outline"
),
&
Font
::
has_outline
);
...
...
@@ -596,8 +597,6 @@ void BitmapFont::_bind_methods() {
ClassDB
::
bind_method
(
D_METHOD
(
"get_texture_count"
),
&
BitmapFont
::
get_texture_count
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_texture"
,
"idx"
),
&
BitmapFont
::
get_texture
);
ClassDB
::
bind_method
(
D_METHOD
(
"get_char_size"
,
"char"
,
"next"
),
&
BitmapFont
::
get_char_size
,
DEFVAL
(
0
));
ClassDB
::
bind_method
(
D_METHOD
(
"set_distance_field_hint"
,
"enable"
),
&
BitmapFont
::
set_distance_field_hint
);
ClassDB
::
bind_method
(
D_METHOD
(
"clear"
),
&
BitmapFont
::
clear
);
...
...
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