English 中文(简体)
如何临时使用与当地注册的同一名称的字体(“使用”)
原标题:how to temporary use a font with the same name as a local registered one (in "use")
  • 时间:2011-04-18 02:07:10
  •  标签:
  • delphi
  • fonts

I know how to register+notify and unregister+notify a font using Delphi. But I want to know what can I do when I have a font which has a similar name with a already registered font (but it s a different version). Maybe even in "use". I can try one of these:

  1. Use the font just locally in the program (but in some situations I don t have access to code because I didn t make it);
  2. Somehow temporary unregister the local one (even if it was in "use"), use the new one as long the program is open and reregister the local one after the program is closed. I would prefer the first but I m not sure 100% that it can be done (I never heard of a font used locally in a normal Windows program but I asked just in case I m wrong). And I don t know if it s ok to forcibly unregister fonts in "use" (if it s possible). But maybe someone has a better idea... Thank you.
最佳回答

告诉用户他安装的同一字体的旧版本,需要安装新的版本,以便他能够体验到新的精细。

即便在安装装置上,你也能够这样做;安装装置是:人们在操作安装装置时预计会改变/改进:

Edit:

If you don t have an installer, then make it clear to the user that he has two options:

  • have it let your app install the updated fotn
  • don t see all the characters
问题回答

改变整个系统环境以达到自身目的的申请,即使是临时性的,通常以否定的方式加以研究。

Say you remove a font, then change it to yours, then your program ends/crashes before the original is restored.

Sounds like you have a variant font you want to use for your application that already uses a name that may be found on the system.

我个人会把你的新界名改成一个独一无二的独一无二之处,使它与现有的界人士 t然冲突。 这样,你就可以在不影响其他申请的情况下使用你。

<>上>

由于你可以更改字体的名称。 我将遵循Jeroen Pluimers的建议,即询问用户是否希望升级。 无需安装装置,从启动申请开始便可进行安装。 但是,询问用户远远胜于沉默地这样做。

Use font locally - bordering on the impossible

Your point "1" should be possible (use a given font only locally) because Web Browsers do it. The @font-face CSS directive can be used in a way to ignore the locally installed fonts. But I suspect doing this the web-browser way is difficult: I didn t see any way to CreateFont using a TTF file. I suspect web browser do it by re-implementing the whole text rendering engine. This is very likely because they usually support more then one type of font files.

If you do get this to work, it s not going to work with standard API s. You re not going to set the Font property on a label and automatically get it to render using the given "local" font. You re definitively not going to get this working with an unmodified application.

Replace Windows font - very bad idea

不幸的是,正如罗伯特提到的,这不是你应该做的事。 如果用户与exact发生联系 你的名声,你们认为你是更好的吗? 在这种不太可能的情况下,如果用户安装了一台背心器,就应当使用用户所拥有的任何东西,并责怪用户。

Possible solutions

  • Use images in place of the special-typography text. Works for small amounts of fixed font size text.
  • Put your text into a TWebBrowser and style it with CSS to use your local, alternative font.




相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签