Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for get_first_char #156

Closed
Yardie- opened this issue Jul 12, 2022 · 3 comments
Closed

Documentation for get_first_char #156

Yardie- opened this issue Jul 12, 2022 · 3 comments

Comments

@Yardie-
Copy link

Yardie- commented Jul 12, 2022

In the documentation for get_first_char it states

        This function is used to return the first character code in the current
        charmap of a given face. It also returns the corresponding glyph index.

        :return: Glyph index of first character code. 0 if charmap is empty.

        **Note**:

          You should use this function with get_next_char to be able to parse
          all character codes available in a given charmap. The code should look
          like this:
          
          Note that 'agindex' is set to 0 if the charmap is empty. The result
          itself can be 0 in two cases: if the charmap is empty or if the value 0
          is the first valid character code.
 

There is no example.

@HinTak
Copy link
Collaborator

HinTak commented Jul 12, 2022

There is. Look at ftdump.py in the examples directory.

@Yardie-
Copy link
Author

Yardie- commented Jul 12, 2022

You didn't even read the issue then you close it.

That is not what the documentation says it references it in get_next_char as

You should use this function with FT_Get_First_Char to walk over all character codes available in a given charmap. See the note for this function for a simple code example.

As I said before in get_first_char it specifically says.

The code should look like this:
Then nothing

So you think it's reasonable that someone searches through 700K in 39 files for three lines of code rather than fixing the documentation. That's rather strange

@HinTak
Copy link
Collaborator

HinTak commented Jul 12, 2022

This is an open-source project, worked on by volunteers. If you think the documentation is incomplete/wrong, please feel free to improve it with a pull.

I assume that paragraph was copied from upstream (ie freetype) with the c code inline snipplet deleted. That said, your basic assertion was incorrect - there is an example, and in quite an obvious place too. Besides, you can do search on github's project page on a per repo basis, which would locate it immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants