[RDP]A glyph is a bitmap representation of a character

13 篇文章 0 订阅
关于RDP中的文本是如何取出的,一直不得其要领,在MSDN上看到的 一句有关的话
RDP text is displayed by using glyph caching. Almost immediately, the client builds up the required set of glyphs, and the server needs only transmit a short hash value to display the text.

可能有关的代码:
#define DO_GLYPH(ttext,idx) /
{/
  glyph = cache_get_font (font, ttext[idx]);/
  if (!(flags & TEXT2_IMPLICIT_X))/
  {/
    xyoffset = ttext[++idx];/
    if ((xyoffset & 0x80))/
    {/
      if (flags & TEXT2_VERTICAL)/
        y += ttext[idx+1] | (ttext[idx+2] << 8);/
      else/
        x += ttext[idx+1] | (ttext[idx+2] << 8);/
      idx += 2;/
    }/
    else/
    {/
      if (flags & TEXT2_VERTICAL)/
        y += xyoffset;/
      else/
        x += xyoffset;/
    }/
  }/
  if (glyph != NULL)/
  {/
    x1 = x + glyph->offset;/
    y1 = y + glyph->baseline;/
    XSetStipple(g_display, g_gc, (Pixmap) glyph->pixmap);/
    XSetTSOrigin(g_display, g_gc, x1, y1);/
    FILL_RECTANGLE_BACKSTORE(x1, y1, glyph->width, glyph->height);/
    if (flags & TEXT2_IMPLICIT_X)/
      x += glyph->width;/
  }/
}


然后,又找到了 一处:

4 Rather than using font negotiation, RDP implements a glyph and fragment caching mechanism. A glyph is a bitmap representation of a character and its font information. For example, the character "A" in Times New Roman is represented by a different glyph than the character "A" in Arial. The use of glyphs allows characters to be displayed precisely regardless of the client operating systems and the locally installed fonts. A string of glyphs is called a 'fragment'. Because glyphs and fragments are cached locally at the client, the server improves bandwidth utilization by not resending the same glyphs. Instead, it tells the client to reuse a cached glyph or fragment.


字符串实际传递的还是字型的点阵,点阵实际是一个位图,也就是说,字符串的内容是无法简单识别的.文档中也说明了,文本所以不直接传递纯文本,第一是不安全,文本中可能包含敏感信息而被黑客盗用.第二是使用位图点阵,可以保证不同的操作系统可以得到相同的显示结果.


看来,取得文本内容的努力算是失败了?


评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值