From 24890ced7ad7ec02466c4adeeac98f76266b3db9 Mon Sep 17 00:00:00 2001 From: the-be-to <94103261+the-be-to@users.noreply.github.com> Date: Tue, 11 Nov 2025 17:09:22 +1100 Subject: [PATCH 1/2] Remove redundant parameter of get_next_char --- freetype/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/freetype/__init__.py b/freetype/__init__.py index b681264..852e264 100644 --- a/freetype/__init__.py +++ b/freetype/__init__.py @@ -1395,7 +1395,7 @@ def get_chars( self ): charcode, agindex = self.get_first_char() yield charcode, agindex while agindex != 0: - charcode, agindex = self.get_next_char(charcode, 0) + charcode, agindex = self.get_next_char(charcode) yield charcode, agindex def get_first_char( self ): @@ -1419,7 +1419,7 @@ def get_first_char( self ): charcode = FT_Get_First_Char( self._FT_Face, byref(agindex) ) return charcode, agindex.value - def get_next_char( self, charcode, agindex ): + def get_next_char( self, charcode ): ''' This function is used to return the next character code in the current charmap of a given face following the value 'charcode', as well as the @@ -1427,7 +1427,7 @@ def get_next_char( self, charcode, agindex ): :param charcode: The starting character code. - :param agindex: Glyph index of next character code. 0 if charmap is empty. + :return: next character code, glyph index of next character code or 0 if charmap is empty. **Note**: @@ -1438,7 +1438,7 @@ def get_next_char( self, charcode, agindex ): Note that 'agindex' is set to 0 when there are no more codes in the charmap. ''' - agindex = FT_UInt( 0 ) #agindex ) + agindex = FT_UInt() charcode = FT_Get_Next_Char( self._FT_Face, charcode, byref(agindex) ) return charcode, agindex.value From 955414e24763cf34612e9bafce1dddaf5fdd71c6 Mon Sep 17 00:00:00 2001 From: the-be-to <94103261+the-be-to@users.noreply.github.com> Date: Tue, 11 Nov 2025 17:10:16 +1100 Subject: [PATCH 2/2] Adjust example --- examples/ftdump.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ftdump.py b/examples/ftdump.py index 0913799..fb62c55 100644 --- a/examples/ftdump.py +++ b/examples/ftdump.py @@ -241,7 +241,7 @@ def Print_Charmaps( face ): charcode, gindex = face.get_first_char() while ( gindex ): print( " 0x%04lx => %d" % (charcode, gindex) ) - charcode, gindex = face.get_next_char( charcode, gindex ) + charcode, gindex = face.get_next_char( charcode )