All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Testov <vladimir.testov@rosalab.ru>
To: grub-devel@gnu.org
Cc: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
Subject: Re: [PATCH] multistring support in gui_label
Date: Wed, 17 Apr 2013 15:39:54 +0400	[thread overview]
Message-ID: <1369975.AMEnTUhb9u@icedphoenix> (raw)
In-Reply-To: <21349117.1Nj3dUL9Cm@icedphoenix>

On Wednesday, April 17, 2013 01:02:44 PM Vladimir Testov wrote:
> O.k. Here it is.
> 
> from grub-core/font/font.c  line 1387 function blit_comb :
> >            do_blit (combining_glyphs[i],
> >            
> >                    main_glyph->device_width
> >                    
> >                     + combining_glyphs[i]->offset_x,
> >                     -(combining_glyphs[i]->height
> >                     
> >                       + combining_glyphs[i]->offset_y), &ctx);
> >            
> >            add_device_width (combining_glyphs[i]->device_width, &ctx);
> >          
> >          }
> >        
> >        }
> >    
> >    }
> >  
> >  add_device_width ((above_rightx >
> >  
> >                     below_rightx ? above_rightx : below_rightx) -
> >                    
> >                    (main_glyph->offset_x + main_glyph->width), &ctx);
> >  
> >  add_device_width (above_leftx - main_glyph->offset_x, &ctx);
> >  if (glyph && glyph->device_width < min_devwidth)
> >  
> >    glyph->device_width = min_devwidth;
> >  
> >  if (device_width && *device_width < min_devwidth)
> >  
> >    *device_width = min_devwidth;
> 
> ***device_width is changed sometimes.
> 
> from grub-core/font/font.c line 1458 function  grub_font_construct_dry_run :
> >  if (device_width)
> >  
> >    *device_width = main_glyph->device_width;
> >  
> >  if (!glyph_id->ncomb && !glyph_id->attributes)
> >  
> >    return main_glyph;
> >  
> >  combining_glyphs = grub_malloc (sizeof (combining_glyphs[0])
> >  
> >                                  * glyph_id->ncomb);
> >  
> >  if (glyph_id->ncomb && !combining_glyphs)
> >  
> >    {
> >    
> >      grub_errno = GRUB_ERR_NONE;
> >      return main_glyph;
> >    
> >    }
> >  
> >  for (i = 0; i < glyph_id->ncomb; i++)
> >  
> >    combining_glyphs[i]
> >    
> >      = grub_font_get_glyph_with_fallback (main_glyph->font,
> >      
> >                                           glyph_id->combining[i].code);
> >  
> >  blit_comb (glyph_id, NULL, bounds, main_glyph, combining_glyphs,
> >  
> >             device_width);
> >  
> >  if (combining_glyphs_out)
> >  
> >    *combining_glyphs_out = combining_glyphs;
> >  
> >  else
> >  
> >    grub_free (combining_glyphs);
> >  
> >  return main_glyph;
> 
> ***return value *device_width set to main_glyph->device_width before
> main_glyph->device_width is changed during execution of blit_comb
> 
> If we want to get device_width of some glyph - we use function
> get_constructed_device_width. It returns device_width parameter of the asked
> glyph with parameter *device_width of the function
> grub_font_construct_dry_run.
> 
> When we actually construct glyph, we take device_width from glyph-
> 
> >device_width.
> 
> The most adequate way to find device_width of grub_unicode_glyph is to call
> grub_font_get_constructed_device_width. But it is miscalculated in some
> cases.
> 
> So these two values are different in some cases (This is all about problem
> 2)
> 
> Suggested patch to fix this problem (second one) is attached.
> 
> I will remake the patch for multistring support for the upstream version.

Looks like I've misunderstood something... Sorry. Can't see where the problem 
is...

-- 
With best regards,
_______________________________
Vladimir Testov, ROSA Laboratory.
www.rosalab.ru


  parent reply	other threads:[~2013-04-17 11:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16  9:04 [PATCH] multistring support in gui_label Vladimir Testov
2013-04-16 17:10 ` Andrey Borzenkov
2013-04-17  6:56   ` Vladimir Testov
2013-04-17  7:01 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-04-17  9:02   ` Vladimir Testov
2013-04-17 11:16     ` Vladimir Testov
2013-04-17 11:39     ` Vladimir Testov [this message]
2013-04-17 12:41       ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-04-23 11:58       ` Vladimir Testov
2013-04-23 16:26         ` [RFC][PATCH] " Vladimir Testov
  -- strict thread matches above, loose matches on Subject: below --
2013-03-22 15:58 [PATCH] " Vladimir Testov
2013-04-03  7:20 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-03-21 17:17 Vladimir Testov
2013-03-21 18:12 ` Gerard Butler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1369975.AMEnTUhb9u@icedphoenix \
    --to=vladimir.testov@rosalab.ru \
    --cc=grub-devel@gnu.org \
    --cc=phcoder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.