[haiku-bugs] [Haiku] #17523: Incorrect right edge is reported for the characer "U" under Noto Sans Display Italic

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Sun, 09 Jan 2022 06:43:32 -0000

#17523: Incorrect right edge is reported for the characer "U" under Noto Sans
Display Italic
-----------------------+--------------------------
 Reporter:  hgsfghs    |       Owner:  nobody
     Type:  bug        |      Status:  new
 Priority:  normal     |   Milestone:  Unscheduled
Component:  - General  |     Version:  R1/beta3
 Keywords:             |  Blocked By:
 Blocking:             |    Platform:  All
-----------------------+--------------------------
 Run the following code:

 {{{
     BFont ft;
     ft.SetSize (52);
     ft.SetFamilyAndStyle ("Noto Sans Display", "Italic");
     const char *str = "U";
     float fl;
     edge_info ei;
     ft.GetEscapements (str, strlen (str), (float *) &fl);
     ft.GetEdges (str, strlen (str), (edge_info *) &ei);
     vw->LockLooper ();
     vw->SetHighColor (128, 0, 255, 255);
     vw->SetPenSize (1.0);
     vw->StrokeRect (BRect (0, 0, (ei.right + fl) * ft.Size (), 30));
     vw->MovePenTo (0, 50);
     vw->SetFont (&ft);
     vw->SetHighColor (128, 255, 255, 0);
     vw->DrawString (str);
     vw->UnlockLooper ();
 }}}

 The cyan text will draw outside the purple rectangle, which is
 incorrect, since the escapement + right edge should be the right-most
 pixel that is drawn onto the display.

 Thanks.
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/17523>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: