EditorLineEnds.ttr – what is it?
Posted by jpluimers on 2011/09/29
Sometimes when you start Delphi 2005..2010 multiple times, you get an error message similar to this:
[Error]
Cannot create file "C:\DOCUME~1\username\LOCALS~1\Temp\EditorLineEnds.ttr". The process cannot access the file because it is being used by another process.
[OK]
Edit: It looks like some people have issues with Delphi 2006 and higher in combination with Windows 7 and higher and KB2982791 or KB2993651 installed. I only do for Delphi 2006 (for 2007 and higher I use the IdeFixPack from Andreas Hausladen). Thomas Mueller wrote a workaround which works in Delphi 2006 and up: Delphi 2007 error: “Cannot create file C:\Users\Admin\AppData\Local\Temp\EditorLineEnds.ttr” – Stack Overflow.
Since there are [WayBack] are [WayBack] a [WayBack] few [WayBack] QC [WayBack] entries on the EditorLineEnds.ttr file: what is it?
In fact, there are two files in that %TEMP% directory: EditorLineEnds.ttr and EditorLineEnds.for
EditorLineEnds.ttr is a TrueType font (you can copy it to EditorLineEnds.ttf and view it using the font viewer that Windows has built-in).
EditorLineEnds.for is actually a FON file not with a bitmap FON, but redirecting (using the FONTDIR and FONTRES entries, also supported by the Odin Font support and the Python mkwinfont utility) to an external font resource in EditorLineEnds.ttr.
Since a FON file is stored as a Portable Executable file format, it is loadable as a Windows module (and you can use TDUMP with the -e parameter to dump it as a Windows executable). I think the EditorLineEnds.ttr can be in the same directory as the EditorLineEnds.for file, but the EditorLineEnds.for file actually specifies the complete path to the EditorLineEnds.ttr file.
I’m not sure why Delphi generates these resources on-the-fly, as it would have been about as easy to install this font as a regular Windows font.
Since the TrueType font has been created by Allen Bauer in 2002, and modified in 2004. He is still at the Delphi team, so he might comment :)
Both files are loaded using the CreateScalableFontResource API call, which makes it hard to sandbox the Delphi IDE.
You can view the content with the d4p fonts.exe TrueType/OpenType font viewer: it contains 4 glyphs; 0x030, 0x031, x0031, 0x32.
You can dump the contents of a TrueType font using the TTFDump tool provided by the Microsoft Tyography Internal Tools.
The EditorLineEnds.ttr includes these tables (with links to Apple/Adobe), of which these tables are supported by Windows:
- OS/2: OS/2 and Windows Metrics
(with the vendor ID BORL. BORL used to be the NASDAQ symbol for Borland stock) - cmap/cmap: Character To Index Map
- gasp/gasp: Grid-fitting And Scan-conversion Procedure
- glyf/glyf: Glyph Data
- head/head: Font Header
- hhea/hhea: Horizontal Header
- hmtx/hmtx: Horizontal Metrics
- loca/loca: Index To Location Table
- maxp/maxp: Maximum Profile
- name/name: Naming Table
- post/post: PostScript Metrics
It lacks these tables:
Some strings from the EditorLineEndings.ttr file:
- © 2002 Borland Software Corporation
- Editor Line Endings
- Regular
- Borland Software Corp.
- Line Ending Font
- EditorLineEnds
- Version 1.00; August 16, 2002
- LineEnds is a trademark of Borland Software Corporation
- Typeface
- Version 1.01; March 26, 2004
- Borland Software Corp – Allen Bauer
- Font designed for display line break styles in Delphi IDE Editor
- http://www.borland.com
Another odd thing is: I have never seen the glyphs provided in the EditorLineEnds.ttf file inside the IDE.
So if anyone knows where this is actually being used: please let me know :)
–jeroen
Edit:
Eric said
Go to Editor Options, and check show tabs, show space, show line break. You’ll then see them :-)
jpluimers said
Ha, thanks for pointing that out to me. I knew it had to be straight forward, and somehow a tiny voice in the back of my head was whispering “it is dead simple, stupid!”. Thanks for showing how simple it actually is :)
–jeroen