Skip to content

Simply wrong code with cairo format_A1 for Bitmap.make_image_surface #1

Description

@HinTak

The code around line 3315 for Bitmap.make_image_surface is simply wrong:

...
        if self.pixel_mode == FT.PIXEL_MODE_MONO :
            cairo_format = cairo.FORMAT_A1
        elif self.pixel_mode == FT.PIXEL_MODE_GRAY :
            cairo_format = cairo.FORMAT_A8
...

Freetype pixel mode mono is most-significant bit first, while cairo format A1 is host order, and least-significant-bit first on small-endian platform, such as x86/x86_64.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions