View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015335VTK(No Category)public2015-02-20 11:142016-08-12 09:55
ReporterLuc Habert 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0015335: vtkFreeTypeTools expects bitmaps where pixel_mode==FT_PIXEL_MODE_GRAY but freetype sometimes returns mono bitmaps
DescriptionWith Calibri size 12, freetype returns bitmaps where pixel_mode==FT_PIXEL_MODE_MONO, which are rejected by vtkFreeTypeTools. I could get it to work by modifying the loop in vtkFreeTypeTools::RenderCharacter :

    bool gray = bitmap->pixel_mode == FT_PIXEL_MODE_GRAY;

    for (int j = 0; j < bitmap->rows; ++j)
      {

      int iB = 0, ib = 7;

      for (int i = 0; i < bitmap->width; ++i)
        {
      unsigned char value;
      if (gray)
      {
        value = glyphPtrRow[i];
      }
      else
      {
        value = 255 * (glyphPtrRow[iB] & 1 << ib);
        if (ib == 0)
        {
            ib = 7;
            ++iB;
        }
        else
        {
            --ib;
        }
      }

then replace "*glyphPtr" with "value". Finally, later in the file, replace

  if (bitmap->pixel_mode != ft_pixel_mode_grays)

with

  if (bitmap->pixel_mode != ft_pixel_mode_grays && bitmap->pixel_mode != FT_PIXEL_MODE_MONO)
TagsNo tags attached.
ProjectTBD
Typeincorrect functionality
Attached Files

 Relationships

  Notes
(0034268)
Luc Habert (reporter)
2015-02-20 11:21

Actually, 255 * (glyphPtrRow[iB] & 1 << ib); was fairly stupid of mine. The correct version is

value = (glyphPtrRow[iB] & 1 << ib) ? 255 : 0;
(0037367)
Kitware Robot (administrator)
2016-08-12 09:55

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2015-02-20 11:14 Luc Habert New Issue
2015-02-20 11:21 Luc Habert Note Added: 0034268
2016-08-12 09:55 Kitware Robot Note Added: 0037367
2016-08-12 09:55 Kitware Robot Status backlog => closed
2016-08-12 09:55 Kitware Robot Resolution open => moved
2016-08-12 09:55 Kitware Robot Assigned To => Kitware Robot


Copyright © 2000 - 2018 MantisBT Team