Skip to content

XPCE on SDL Cairo Pango compatibility

Jan Wielemaker edited this page Jul 28, 2025 · 3 revisions

Compatibility notes

  • To fill an object with the foreground colour, the old system would fill with @black_image and set the colour. The new system uses the reserved names foreground and background.
  • Set image->background to @nil to create an image with transparent background.
  • SDL does not allow to specify the location if windows (XPCE frames). Positions are thus ignored. It does allow specifying the location of transient frames relative to the parent frame. The X,Y of a frame is handled as relative to the parent frame for transient frames.
  • Several X11-specific methods on class display have been removed. In particular display->synchronise and display->flush.
  • Class image is seriously changed (but not yet cleaned). All images are not 32-bit RGBA Cairo surfaces that are loaded through the SDL image library. The supported image file formats depend on the how the SDL image library has been built.
  • There is a special mode for images with only white, black and fully transparent pixels. By default, these are assigned the image<-kind bitmap. When displayed, white pixels are mapped to the current background and black pixels to the current foreground.
  • Class colour_map has been removed.
  • Class colour is seriously modified. Colours are now always 32-bit RGBA (0..255 per channel). Named colours are still supported using the same X11/CSS based colour names. The implications should be minimal except for programs that specified the colour components explicitly as the range changed from 16-bits to 8 bits.
  • Class font is seriously modified. All X11 specific code is removed, fully concentrating on modern TrueType Pango fonts. A default triple font(Family,Style,Points) is mapped as follows:
    • First, Family is mapped over @font_families, which maps the generic names mono, sans and serif to Pango family names. These are controlled by the resource font.font_families that have platform specific defaults. For compatibility, screen, helvetica and times are accepted as synonyms for mono, sans and serif. If Family does not appear in @font_families it is passed directly to Pango. The font specific resources have been moved from class display to class font (in X11, fonts are server properties and an XPCE display represented an X11 server).
    • Applications using the alias names should run unmodified. Applications using font(Family,Style,Points) should typically update the Family using screen->mono, helvetica->sans and times->serif. courier is normally available, but compared to modern monospaced fonts it typically looks crude.
  • Class monitor has been removed. The system creates and destroys instances of class display to reflect the currently attached displays. @display refers to the initial primary display. The frame<-display property reflects the actual display used by the frame and is updated if a frame is moved to another display.

Clone this wiki locally