Delphi形式的TRectangle TText Unicode [英] Unicode in Delphi form TRectangle TText

查看:159
本文介绍了Delphi形式的TRectangle TText Unicode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Delphi&的新手.在DelphiXE4编辑器中,我试图在窗体上使用x64 TRectangle作为棋盘(替代颜色)制作棋盘图形用户界面.我想添加unicode棋子,但是当我添加unicode时,它在ObjectInspector属性中显示在表单上.如何将Unicode添加到TText(以便表单将unicode作为棋子显示)? (在我想将Dragndrop添加到TRectangles/unicode国际象棋中时,有任何想法吗?).

I'm new to Delphi & in DelphiXE4 editor I am trying to make chessboard gui on form, using x64 TRectangle for board (alternate colors). I want to add unicode chess pieces but in ObjectInspector properties when I add unicode it displays literally on the form. How can I add Unicode to TText (so the form displays unicode as chess pieces)? (After I want to add dragndrop to TRectangles/unicode chess-any ideas?).

Rectangle63: TRectangle;
Rectangle64: TRectangle;
Text1: TText;
Text2: TText;

以下是显示问题的屏幕截图:

Here is screenshot showing problem:

非常感谢您的帮助

Jeroen的答案为我解决了这个问题(我通过将实际的unicode国际象棋棋子图像复制/粘贴到TText文本属性中来完成).到目前为止,我已经添加了exe的屏幕截图.接下来,我想将DRAGNDROP添加到这些片段中.....

Jeroen's answer worked to solve this for me (which I did by copy/paste the actual unicode chess piece image into TText text property). I add screenshot of exe so far. Next up I want to add DRAGNDROP to these pieces.....

(Jeroen字体大小问题已修复) 修复了Unicode黑王显示-参见屏幕截图:

(Jeroen-font size issue fixed) Fixed unicode black king display-see screenshot:

推荐答案

Unicode棋子可以在任何Delphi应用程序中显示,只要您喜欢其中包含用于字形字形 CodePoints "nofollow> Unicode 代表棋子.

The Unicode Chess Pieces can be shown in any Delphi application provided you have a fond that contains the Glyphs for the various CodePoints in Unicode representing the Chess Pieces.

实际上,什么平台或开发环境都没有关系 您可以使用,只要它们支持Unicode并且您拥有正确的字体即可.

Actually, it does not matter what platform or development environment you use, as long as they support Unicode and you have the right font.

您需要:

  1. 一种输入这些Unicode CodePoints的方式
  2. 在目标平台上将这些Unicode代码点表示为字形的字体

从最后开始,对于 Microsoft Windows ,这些字体可以正常工作:

To start with the last, for Microsoft Windows, these fonts work fine:

  • Segoe UI
  • Tahoma
  • Arial Unicode MS

要输入这些内容,请在 Microsoft Windows 上使用两种方法:

For entering these there are two approaches on Microsoft Windows:

  1. 如果在注册表中启用它:通过十六进制 Unicode CodePoint数字键盘上的href ="http://en.wikipedia.org/wiki/Alt_code" rel ="nofollow"> Alt代码
  2. 从应用程序中复制/粘贴(即 Unicode输入:从屏幕中进行选择),将其提供为文本
  1. if you enable it in the registry: enter hexadecimal Unicode CodePoint numbers through Alt-codes on the keyboard
  2. copy/paste them from an application (i.e. Unicode Input: Selection from Screen) that provides them as text

对于复制/粘贴,我经常使用 Web浏览器转到带有正确字符的网页支持Unicode的a>,或使用字符地图应用程序进行搜索.

For copy/paste, I often go to a web page with the correct characters using a Web Browser that supports Unicode, or search for them using the Character Map application.

要简化复制/粘贴操作,请执行以下操作:

To make copy/paste easier:

  • 这些是白色的东西:♔♕♖♗♘♙
  • 这些是黑色的东西:♚♛♜♝♞♟

示例FireMonkey表单,其中所有片段都包含在 TText TTRectangle :

Example FireMonkey form with all the pieces in 1 TText in one TTRectangle:

object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 480
  ClientWidth = 640
  FormFactor.Width = 320
  FormFactor.Height = 480
  FormFactor.Devices = [dkDesktop, dkiPhone, dkiPad]
  DesignerMobile = False
  DesignerWidth = 0
  DesignerHeight = 0
  DesignerDeviceName = ''
  DesignerOrientation = 0
  object Rectangle1: TRectangle
    Height = 50.000000000000000000
    Width = 80.000000000000000000
    object Text1: TText
      Color = claBlack
      Height = 50.000000000000000000
      Text = #9812#9813#9814#9815#9816#9817#9818#9819#9820#9821#9822#9823
      Width = 80.000000000000000000
    end
  end
end

编辑

我认为您的表单文件中存在字体大小问题.使用表单文件的文本创建一个新问题.做到这一点的两种方法:

I think you have a font size issue in your form file. Create a new question with the text of your form file. Two ways to do that:

  1. 打开记事本,然后在记事本中打开您的表格附带的.FMX文件;将文本复制到剪贴板
  2. 在Delphi中,右键单击表单,然后选择以文本查看",选择所有文本并将其复制到剪贴板,右键单击表单文本,然后选择以表单查看".

将代码粘贴到 http://pastebin.com/

Paste the code at http://pastebin.com/ or https://gist.github.com/ then post that link in a new question. After that comment here you did and I will take a look.

这篇关于Delphi形式的TRectangle TText Unicode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆