Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
P
pango
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 213
    • Issues 213
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 11
    • Merge Requests 11
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • pango
  • Issues
  • #5

Closed
Open
Opened Nov 08, 2002 by bugzilla-migration@bugzilla-migrationReporter

Use typedef for Pango units?

Submitted by ton..@..un.com

Assigned to Behdad Esfahbod

Link to original bug (#98013)

Description

Pango uses 'int' to represent both device units and Pango units (1/PANGO_SCALE device units).

Working out whether an 'int' represents device units or Pango units comes down to reading the documentation, but sometimes that doesn't tell you. For example, the x_pos argument to pango_glyph_string_x_to_index() is documented as "the x offset (in thousands of a device unit)", but the x_pos argument to pango_glyph_string_index_to_x() is documented as "location to store result"

Making a typedef for Pango units, e.g.:

typedef int PangoUnit;

in pango-types.h and using the typedef for all parameters and return values that are in Pango units will make the uses of Pango units obvious even if someone reads just the header files instead of the documentation.

Version: 1.1.x

Assignee
Assign to
Small API
Milestone
Small API
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/pango#5