Results 1 to 28 of 28

Thread: Release of the CUF (font & text rendering) mod tool

  1. #1

    Arrow Release of the CUF (font & text rendering) mod tool

    The Europa Barbarorum Team hereby releases the results of its efforts to open up the CUF file format for modding. The “CUF” project provides modders with tools to create their own CUF fonts as well as incorporate basic support for “rich text” in their mods. Originally developed for manipulating the CUF fonts bundled with these games, the “CUF” project has progressed so far we believe that others would want to use this tool for their own purposes as well. A screenshot or two may help to explain why we feel that such confidence is justified:



    The tool allows you to convert TrueType or Type1 fonts to a CUF file; as well as make more advanced use of the strings.bin format in tandem with the CUF format to manipulate the way descriptions are rendered and produce multiple font styles alongside each other in the same “body” of text. The screenshot above shows how that might look.

    The project can be downloaded from our FTP server right here: ftp://europabarbarorum.org/CUF-src-dist.7z. The download consists of a single compressed 7zip archive containing:
    • Java source code (requires Java 1.6 JDK to build) and resources
    • A COPYRIGHT file containing the licence under which the project is made available (see below)
    • A readme.html file containing instructions for building from source, running it and using it to get some modding done. The file also contains links to download additional required software: it is very much recommended that you read this file.
    • Ant build scripts to make building from source easy (requires Ant 1.7.1 or higher to build)
    • A POSIX sh script which you can use as example for creating your own scripts that run the program under specific settings. Note that it is not required to use such a script; also note that it is not a batch file.

    Programs such as 7-zip can be used to extract these contents. (You can get 7-zip from here: http://www.7-zip.org/ or commandline equivalent p7zip from here: http://p7zip.sourceforge.net/ )

    People who do not want to build from source can download the following compressed 7-zip archive instead: ftp://europabarbarorum.org/CUF-bin-dist.7z. This version contains:
    • The tool in the form of a single JAR file (dist/CUF.jar)
    • The help bundle (dist/cuf-help.jar). JavaHelp is required to use it, you can get JavaHelp from here: https://javahelp.dev.java.net/
    • A COPYRIGHT file containing the licence under which the project is made available (see below)
    • A readme.html file containing instructions for building from source, running it and using it to get some modding done. The file also contains links to download additional required software: it is very much recommended that you read this file.
    • A sample lib/nblibraries.properties file you can use to configure the tool to link against additional libraries (JAR files) at start up. This may be necessary for using the Help feature (depending on how you install JavaHelp).
    • Code documentation for use as reference material when building more complex scripts to automate the tool. (dist/help/javadoc)


    Both versions (source and binary only) are made available under the following licence:
    Copyright (c) 2010, The Europa Barbarorum Team
    All rights reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
    * Neither the name of The Europa Barbarorum Team nor the
    names of its contributors may be used to endorse or promote products
    derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    DISCLAIMED. IN NO EVENT SHALL The Europa Barbarorum Team BE LIABLE FOR ANY
    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    Our knowledge of the CUF file format is by no means infallible; as is evident from the screenshot marking most CUF properties as `purpose unknown'. This obviously reflects on how the end result looks compared to a preview generated by the tool: while the preview is roughly accurate, it is necessarily a simplified render and thus does not reflect the precise rendering method of the game engine. Consequentially precise text alignment is at the moment somewhat hit & miss and best results come from using font sizes that correspond with the fonts used by CA.[*] Further research in the details of CUF font rendering as it is performed by the M2TW engine will be required to make the results more robust in this regard.

    Comments, criticism, improvements and bug reports are welcome. Regards,

    The Europa Barbarorum Team.

    * Note that alignment does not refer to how individual glyphs align with each other; rather it refers to how a line of text aligns to its bounding box (e.g. how a label aligns on a button).
    Last edited by Tellos Athenaios; 09-13-2010 at 22:58. Reason: 7zip archives now
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  2. #2

    Default Re: Release of the CUF (font & text rendering) mod tool

    Pushed out an update to the files on the EB FTP server (since the links in post #1 point to those, these are automatically updated as well).

    A summary of the changes:

    New Features
    • Use escape characters as a more robust alternative to source indentation or newlines which means less risk of damage by braindead text-editors and other ills. Also allows you to type in multi-line preview texts.
    • Tab base text alignment and text flow calculations. The tool is now able to generate Strings files which horizontally align pieces of text on individual lines.
    • FontStyle: removes the need to know about lower level Java packages in order to be able to work with font attributes (e.g. shape width and stroke weight, underline and strikethrough)
    • Support listening for compile events so it becomes easier to write the glue to manage scripts run through fork.
    • Made the Strings compiler a more modular structure so it becomes possible to compile Strings from other things than XML files.
    • Added a few different StringSources, the most notable of which is the EditorSource which allows you edit an existing Strings file.
    • (Improved) support for order strings files. Previously the only format that could be read & written was something I call “keyed”: it stores string keys and values, and it is used for most descriptions (e.g. export_units.strings.bin). However some files use a slightly different Strings file format, which omits the keys. The CUF program/libraries now support this variation, too.


    Bugfixes
    • Fixed a fromFile() method which returned null when loading system fonts.
    • Fixed the same fromFile() method to strip the font family attribute from the delta map it uses. This is required for correctly handling font files that are not installed in the system environment.
    • Report script file names correctly when an error occurs.
    • Fixed some outdated Javadoc, added some more for previously undocumented elements.
    • Fixed misleading error message from SAXHandler. This bug would not ordinarily manifest itself in the previous version of the tool because the conditions for it to occur were not yet supported anyway... However with the introduction of tab support/layout you can now make additional errors which highlighted this bug during testing.


    Misc changes
    • Changed structure of strings package. There is now a strings.impl package as a result of making the Strings compiler more modular.
    • Moved some parsing code around to enable better re-use, and improve modularity.
    • Changed CUFSource interface so it no longer requires you to work with ChartableEntry objects, if you don't want to. (Of course the built-in implementations still do.)
    • Enabled cuf.sh script to work when invoked from arbitrary locations.
    • FontToolkit/Shell/StringsToolkit etc. use string pathnames rather than java.io.File objects. The pathnames still expand as if processed with shell.pathParser().parsePath().
    • Some restructuring/fat-removal in the internals of the shell package. This should not affect existing scripts because existing scripts have about zero use for those internals anyway!
    • Changed how compilation is done. The StringsToolkit/FontToolkit now return an object which encapsulates a compilation task, rather than scheduling this task directly. This is required to take advantage of the ability to listen for compile events.
    • Removed FontSnapshot, it no longer had a purpose.
    • Updated readme.html file.


    ... and anything I might have forgotten. Also a screenshot that showcases tab support:
    Last edited by Tellos Athenaios; 06-18-2010 at 21:00.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  3. #3

    Default Re: Release of the CUF (font & text rendering) mod tool

    Updated the tool with a fix to ensure order of records read from strings.bin files is preserved; added option to warn about empty strings in records.

    Changed the compression method of the download, to XZ which promises better compression.

    The binary-only download is now an XZ compressed archive, too: you can find the JAR file inside it as dist/CUF.jar.
    Spoiler Alert, click show to read: 
    I changed the contents of the binary distribution: now, you get copies of COPYRIGHT and readme.html files as well as pre-built program documentation outside the JAR file as well (all in all these additions about double the size to 536KB).
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  4. #4

    Default Re: Release of the CUF (font & text rendering) mod tool

    Another update, another changelog. This one brings:

    • Added a dialog to compile Strings files from XML.
    • Added a dialog to preview Strings files, and added another to preview CUF files.
    • When compiling Strings files can specify an XSLT stylesheet to generate the actual compiled XML from a different XML format. People who want to simplify their XML code and know a bit of XSLT will appreciate the possibilities. (For those who do not know what XSLT is: w3schools.com has an excellent introduction to it.)
    • When compiling Strings files you can specify character encodings to use when the (XML) data is read & fed to the compiler. This is useful for people who insist on not using UTF-8, especially when you must work with UTF-16LE encoded files. (Notepad calls that Unicode.)
    • Fix for num entries field in strings.bin files generated.
    • Fix editControlCharacters() method in FontToolkit to work properly with fonts that have been run through compact() in FontToolkit first.
    • Improved exit handling means that fork'ed shells will run properly if you attempt to exit the program before they have started yet.
    • Misc fixes to show 1-based indices instead of 0-based ones in GUI labels and the like.
    • Compile with debug info by default.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  5. #5

    Default Re: Release of the CUF (font & text rendering) mod tool

    Updated the tool again, this time it contains the following changes:

    Improved support for Windows:
    1. Build scripts use native2ascii which means compiling the tool from source is considerably easier.
    2. Tool forces the use of UTF-8 encoding internally, which fixes some visual glitches on Windows.
    3. Added a Windows Script Host launch script, written in JScript. This means that unless Windows Script Host has been explicitly disabled or something similar, you can use that script on Windows the same way you can use the POSIX sh script with a sh interpreter.


    Other changes:
    1. Added filtering of output for some progress messages: turning the “ChattyShell” preference to off (false), and the number of progress messages will be considerably reduced for large fonts.\
    2. Improved character encoding handling when compiling Strings files: due to some internal changes you can now leave encoding fields blank and let underlying parsers “guess” or (“detect”) the right character encoding in use. One particular benefit of this is that byte order marks are now mostly harmless in XML documents if you do not specify a character encoding yourself (previously you could get a content not allowed in prolog message or similar).
    3. Added dialogs to the CUF shell GUI to run scripts.
    4. Added support for wrapping multiple URI-resolvers in a single one, which is useful in conjunction with a KeyResolver.
    5. Added support for compiling M2TW-style tagged files. Note that it is not at all as robust as compiling from XML files. In StringsToolkit, use the compile() method which takes input file name, output file name, a KeyResolver and a boolean flag to use this feature.
    6. Added IdentityMapping (a kind of StringMapping) which allows you to compile without macros (Macro files): it simply passes its input text on to the other layers of the compiler.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  6. #6

    Default Re: Release of the CUF (font & text rendering) mod tool

    I'm really interested in your project. Should it work for Rome Total War engine?
    There are none so enslaved as those who falsely believe they are free

  7. #7

    Default Re: Release of the CUF (font & text rendering) mod tool

    Depends on whether the version of Rome Total War you have contains CUF files (with .cuf extension).
    Mine (plain old vanilla) doesn't, but maybe one of the extensions (BI or Alexander) does?


    You can check whether they will work (if you have them) by trying to preview them. If that appears to work OK (you get a nice preview rendered in the given font), it means that your CUF files from RTW are structured the same way as those from M2TW and that in turn means you can use the program to create your own replacement fonts.
    Last edited by Tellos Athenaios; 08-14-2010 at 04:01.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  8. #8

    Default Re: Release of the CUF (font & text rendering) mod tool

    Pushed out a minor update which improves upon the tool in several small ways:

    In FontToolkit (org.europabarbarorum.cuf.shell.FontToolkit):
    • Added fixChartableCompatibilityFor() methods. These can be used to make a font with re-mapped character tables (e.g.: a font treated with compact() or map() or editControlCharacters()) conform to how M2TW treats the CUF files: you select a subportion of the complex font which is to be presented in a compatible fashion (in the example given you might select plain glyphs) so that text which is not properly localised (is not part of the strings.bin files) . This can be used to fix the display of e.g. unit stats (format strings) in such a font as well as unlocalised text (text which is hardcoded in the M2TW executable, e.g.: the “- ” before author names in quotes).
    • Preserved generic type signatures. This is unlikely to break any scripts relying on FontToolkit. It does not change behaviour of these methods.


    Changed TopLevelSource (org.europabarbarorum.cuf.font.TopLevelSource) to be merely a complementary interface to CUFSource (org.europabarbarorum.cuf.font.CUFSource). In the unlikely event you were using it to inherit the contract for CUFSource methods in addition to its own interface contract, this will break your script. But the good news is:

    I made various CUFSource implementations (MappedSource, RestrictedSource, AbstractCUFSource, and MixedSource) more generic. Hence if you were/are/will-be using a custom implementation of CUFSource you should now find these a lot easier to work with.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  9. #9

    Default Re: Release of the CUF (font & text rendering) mod tool

    New update:

    Fix: missing format specifier for nested namespaces. So if you made that error you now get the proper error message.
    New: font previews/GUI now use a more understandable notation for decimal values & editing works.
    New: marker lines which you can use to judge the effect of layout offset settings on GUI.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  10. #10

    Default Re: Release of the CUF (font & text rendering) mod tool

    Hi, I have a problem about M2TW Fonts:

    Three monts ago I and some of my friends decided to translate M2TW into Turkish. We created a translation group in our web site and started to work on it. We translated some of M2TW files and we have made some progress. But we encountered some problems while translating. We can't use some letters like "Ğ", "ğ", "İ", "Ş", "ş" (which placed in our Turkish alphabet) in some of the text files.

    For example: I tried to change Iconium city name in "imperial_campaign_regions_and_settlement_names.txt" file:


    Result: I can't see city name on the top


    Is there any way to use these letters, add them into M2TW fonts, change some fonts, maybe change font style or something like that?

    I tried to edit some fonts on my computer with TypeTool program but it didn't work.

    Codes:


    We will be happy If you can help us, thanks.

  11. #11

    Default Re: Release of the CUF (font & text rendering) mod tool

    The reason & fix are simple enough:

    Reason: the fonts used by CA for these titles (kp_14.cuf, kpl_60.cuf kp_18.cuf) do not support those characters. As a result they are not rendered.
    Fix: create your own CUF files based off a font that does support those characters.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  12. #12

    Default Re: Release of the CUF (font & text rendering) mod tool

    You are right, I tried to use your mod and saw that kp_14.cuf, kpl_60.cuf kp_18.cuf files does not support that those letters.

    I am sorry, I dont understand programing Java or etc. And how can I make my own cuf file? Is it possible with this program?

    * Sorry for the same post on twc.

  13. #13

    Default Re: Release of the CUF (font & text rendering) mod tool

    I renamed the "font_14.cuf" font as "kp_14.cuf" font and "font_18.cuf" font as "kp_18.cuf" font. It works but I think, I need to change their font size 1 pixel lower. Can you help me please?

  14. #14

    Default Re: Release of the CUF (font & text rendering) mod tool

    Quote Originally Posted by nedensiz1 View Post
    You are right, I tried to use your mod and saw that kp_14.cuf, kpl_60.cuf kp_18.cuf files does not support that those letters.

    I am sorry, I dont understand programing Java or etc. And how can I make my own cuf file? Is it possible with this program?

    * Sorry for the same post on twc.
    Yes it is possible, in fact I would say that it is more or less the point of the program ()[*]. I know the readme.html file is big and perhaps not too useful when you think “help I don't know anything help me please”. Though, on the upside it contains snippets of code where all you have to do copy + pase & change a few values and you are good to go for a simple CUF file. Or if you are really desperate for a ready made sample:
    Code:
    importPackage(org.europabarbarorum.cuf.shell); // get the tools we need
    var sysFont = new FontStyle("Lucida Sans Unicode", 24); // define a font
    sysFont.bold(); // make it bold.
    
    var cufFont = sysFont.getFont(shell); // convert it into something we can save to a CUF file.
    
    FontToolkit kit=new FontToolkit(shell); // toolbox containing lots of handy features.
    
    var job = kit.compile(cufFont, "lucida-sans-unicode-bold-24.cuf"); // create a job for the CUF compiler which will save our font.
    job.attach(shell); // ensures that the shell is disposed of after the script finishes. If it is the only shell currently in use it means that the program will exit after compilation has finished.
    job.run(); // run compilation: a lot of progress messages will appear.
    [*] The program works roughly as follows: you type in commands which it runs (or you supply it a script which it then runs), and apart from that there is a large library of predefined commands/functions/tools/stuff that make it a lot easier to work with CUF files (and strings.bin files).
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  15. #15

    Default Re: Release of the CUF (font & text rendering) mod tool

    Quote Originally Posted by nedensiz1 View Post
    I renamed the "font_14.cuf" font as "kp_14.cuf" font and "font_18.cuf" font as "kp_18.cuf" font. It works but I think, I need to change their font size 1 pixel lower. Can you help me please?
    One pixel lower as in it must be positioned one pixel lower? Or as in: the font is too big? If you mean the latter that is a lot of work, it is much easier to simply generate a new font. The reason is that the CUF files contain all the glyphs (characters if you will) as rendered alpha masks (and other information required to make sense of them), so scaling those down to look 1px smaller is at best a lot of work for little gain (the visual quality of the glyphs will not improve with such butchery).
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  16. #16

    Default Re: Release of the CUF (font & text rendering) mod tool

    Ok, I will try to make my own .cuf fonts. Thanks.

  17. #17

    Default Re: Release of the CUF (font & text rendering) mod tool

    I'm back with another update. Pretty big one this time around:

    CUF files
    • Preliminary support for kerning. This is something that people modding M2TW will probably not give much thought, but this should make the tool compatible with ETW CUF fonts too. Thanks to just at the TWC for pointing out to me how this feature is supposed to work in those files.
    • Added the code to resolve the long standing todo of having some translation layer for CUFProperty objects to provide a better mechanism for checking the values you want to set.
    • Added CUFSourceEditor which is a class that provides support for a declarative approach to editing individual glyph attributes like advance width and y-offset relative to some sort of baseline. This allows people to fix corner badly offset glyphs by injecting better values (this is mainly an issue with italic fonts where rounding errors do more damage to spacing between glyphs). All standard font classes (deriving from AbstractCUFSource) support this feature: you can use edit() and getEdits() respectively to work with it.


    Font previews
    • Better caching for glyphs. By removing the temporary solution with a proper cache anything that has a lot of the same characters being used (e.g. "Hello world") should see a significant speed up when a preview is rendered.
    • Improved support for editing the CUF properties in the table of the preview window.


    CUF Shell:
    • Fix to allow prompting for user input from fork'ed scripts. In particular this includes a rewrite of the way the shells in the GUI obtain your commands and write output to the GUI.


    Help files (need more work to be a proper reference documentation):
    • The tool now contains support for the javax.help (JavaHelp) package which provides a Help browser. In addition the original readme.html file was cut into various pieces which are accessible through this browser (and bundled in dist/cuf-help.jar)
    • Added necessary code to deal with the case where no JavaHelp is present (at compile time and/or at run time) so you can still build & use the CUF tool without it.
    • Changed build scripts so that the Javadoc ends up as part of the help bundle too, which means you can use the search function of the JavaHelp browser to navigate it.

    The Help feature requires JavaHelp, which you can get from here: https://javahelp.dev.java.net/

    Misc:
    • Rather than using an UnsupportedOperationException() stub, some of the code now throws an NotEditableException() when you attempt to do editing operations on read only data (something which would not work anyway).
    Last edited by Tellos Athenaios; 09-13-2010 at 22:54.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  18. #18

    Default Re: Release of the CUF (font & text rendering) mod tool

    Pretty big update:

    Features
    1. Support for JLine. This provides the program with some readline functionality when it runs directly from the command line.
    2. Added a “Fontwizard” GUI which provides a for a simpeler way to produce fonts than by writing your own scripts. You can find it under the Build menu. It is a bit rough round the edges, but
      sufficient for quickly building a font or mocking up something. Use the Export buttons to pop up a dialog for previewing/saving your work.
    3. Added more extensive logging capabilities to the program/software through IOHelp.Log.


    Restructured code layout
    Lots of the auxiliary code has been restructured due to the additions of Fontwizard, JLine support and better logging.

    A particular item of interest is that the code which handles program settings has been moved from org.europabarbarorum.cuf to org.europabarbarorum.cuf.support, and
    that it is now confined to the Setting class (the Prefs class merged with the Setting interface into the Setting class), and the specific program
    settings moved to the modules that actually use them.

    The upshot of these changes is that if you have script code which manipulates program settings directly you will need to update it.

    Another item of interest are the various restrict() methods in FontToolkit: these require now an addition boolean parameter. Old code which used these operations
    should use “true” here (this yields equivalent behavior to previous versions of these restrict() methods). Use “false” to invert the result of the old style
    restrict() methods.

    Bugs
    1. CUFWriter catches a couple more errors you might make and fails with an error message of its own.
      So although the net result will be largely the same, at least you will have a useful error message to work wih.
    2. The control character font now sets the number of glyphs it contains, along with a slight change in CUFWriter's behaviour this
      fixes two edge-cases: a) that CUFWriter previously could fail seemingly random (but see above) if no glyphs were declared on the font,
      b) that someone might actually want to use the control character font more directly.
    3. Add missing check & default values in CUFRenderPanel when looking up certain CUFProperty settings.
    4. Fix Classloader to not load classes that the JVM has already loaded. Prevents doing double work as well as duplicating shared resources.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  19. #19

    Default Re: Release of the CUF (font & text rendering) mod tool

    Important update. This update contains a fix for a bug in the code which generated “keyed” strings.bin files. This fix involves generating proper lookup tables at the end of the file: without those Medieval II/Kingdoms suffer significant performance penalties. Mea culpa, the code that generated the strings.bin files was based off alpaca's bin converter which does not (nor does it need to) deal with this. I would like to thank my fellow EB members who tested and suffered the performance hit for their patience and help in debugging the problem, in particular Atilius and bobbin. Thanks, guys!

    Apart from having a fix which brings performance back to something more reasonable, the silver lining here is that this fix also addresses a bug in the Medieval II/Kingdoms files. Apparently the data/text/export_units.txt.strings.bin files extracted from the game packs are not built correctly either (implying that the game does not convert export_units properly). The lookup table in this file does not refer to the source code, rather it contains a dump of 795 entries for the 265 RTW units from RTW Vanilla (795 = 265 *3, and there are 3 keys per unit in export_units data.)

    This update also contains a simplification of the strings compiler, so the StringsSource types are no longer required. As a result if you were using StringsSources directly, you will need to update to use StringsFeeders. Furthermore setOrder(boolean) in StringsToolkit is gone and replaced with format(String). You can use “Ordered” where previously you would use “true”.

    Furthermore this update incorporates some of the improved understanding of the CUF file format, with regards to certain CUF properties. These are “maximum width” and “maximum height” of glyphs. This means that the suitable values will be automatically inferred by the CUF compiler by default. This behaviour can be controlled/disabled per property through CUFWriter.SetVSize, CUFWriter.SetHSize and CUFWriter.SetGlyphDataSize options: see Javadoc for details.

    This behaviour is new for VSize and HSize properties, both of which refer to cut-off values (if a glyph is wider or taller than either value it appears cut off in the game). The code rendering the previews in the tool do not take these values into account yet. For GlyphDataSize property it means you now have the final control over what is written to the CUF file.
    Last edited by Tellos Athenaios; 11-19-2010 at 07:36.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  20. #20

    Default Re: Release of the CUF (font & text rendering) mod tool

    There's a new important update available. This one fixes a few serious issues, and one less so.
    [list]
    New features:
    • Add support for getting/setting macro names on CUFSources (MacroSource, AbstractCUFSource, Converter).
    • Add support for hiding multiple fonts under a single macro (WrappedSource.MacroSource).
    • Add support for exporting macros from the FontWizard (ExportDialog).
    • Add support for editing CUF properties from the FontWizard.
    • Add support for specifying range of characters in FontWizard.
    • Add support for shifting character of fonts in FontWizard.

    Bugs:
    • Fix reference passing instead of copying arrays in AbstractCUFSource.
    • Fix broken format message for missing macros
    • Fix editing properties on the CUFSource (font) during previews.
    • Fix occasional disabled next/cancel buttons in FontWizard

    Misc:
    • Merge various FontWizard pages to achieve same effect with less code.
    • Move common FontWizard UI to its own package.
    • Move create new font pages to own package.
    • Move algorithms out of FontToolkit.
    • Improve error handling in FontWizard pages when building fonts.
    • Improve error handling when formatting localised messages.
    • Tidy up a number of error messages.
    • Move ComponentState from the fontwizard to the gui.support package.
    • Use different labels on FontWizard next/cancel buttons depending on context.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  21. #21

    Default Re: Release of the CUF (font & text rendering) mod tool

    There is another update of the tool. This update changes how sub shells interact with each other. Shells now live in their own thread (as managed by the JVM) rather than as task in a thread pool (as managed on top of the JVM). This update also fixes the long standing bug of output messages appearing out-of-order when running multiple shells in parallel.

    The result is a tool which is able to tax the CPU more aggressively when a lot of shells are forked, and thus finish parallel tasks faster. Subjectively, the command prompt feels faster from the GUI, as well.

    There are a few other minor changes:
    • Added SAXHelp which contains the tools for XML crunching outside of generating strings.bin files, should you need it. (I did.)
    • Added Context (right click) menu's on text fields and areas with copy/paste/cut actions (as appropriate). Of course you can also use Ctrl+C,Ctrl+V,Ctrl+X.
    • Added alternative PlainKeys mode to FormatOptions for StringsWriter: this version retains the old behaviour where lookup tables would be omitted.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  22. #22

    Default Re: Release of the CUF (font & text rendering) mod tool

    Update of the tool. The update itself is fairly small, but the main changes are worth updating for: a bug squashed and the tool is easier to use.

    Main changes
    • Update Macro, StringMapping and RawHandler to give better error messages.
    • Fixed a bug in FontToolkit.fixChartableCompatibilityFor where it could end up inadvertently dropping characters from the chartable. The method was renamed into fixChartable.
    • Use SortedMaps for chartables in the tool (most of the CUFSources already did this, but some used HashMaps). This ensure that the order of characters in a chartable is maintained for instance when compacting a font.


    Misc changes
    • Move algorithms out of FontToolkit, and together with WrappedSource to the font.impl package. Now there is an AlgorithmSource for these operations. (This change allows the code of the algorithms to be simplified and also makes the code elsewhere a bit neater.)
    • Remove some redundancy in the error messages for bad file types.
    • Fix cuf-impl.xml Ant script which suffered from bit rot. The update-licence task works again on Ant 1.8.1. This has otherwise no effect on the tool.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  23. #23

    Default Re: Release of the CUF (font & text rendering) mod tool

    I've identified & fixed a new problem with the tool: the ScriptRunner component would kill its host shell too soon meaning that the exit code of the program could be 0 (indicating no errors) even if errors did occur. This is sufficiently serious for me to release a new version of the tool.

    This update also contains a few other changes to the tool. The main ones involve the Shell and they are: fork always expects a boolean argument to accompany the CallBack argument (it indicates whether it the CallBack must run in the same thread as the shell on which you call fork), and there is a blockUntilExit method now if you need to block a Shell until another one exits.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  24. #24

    Default Re: Release of the CUF (font & text rendering) mod tool

    The tool has not seen major action over the past few months but it did accumulate a few useful fixes so I'm calling it a release:

    Bugs
    • Fix malformed URI bug which could prevent XSLT stylesheets from completing normally.
    • Fix a repaint bug, which prevented preview screens from being updated in specific corner cases.
    • Fix behaviour of the GUI code in SystemFontUI so selected font and list synchronise properly if you select from the list after selecting a file/typing something manually.
    • Fix a few cases where exceptions were thrown.


    Misc
    • Changes in how Macros are written to remove the date field. This is useful for versioning these files (as copies which are identical except for the date stamp are now identical). Additionally most all data is now in Unicode escape format, which means that all data is now ASCII. Both changes have no effect on how the Macros are read or used, and old files continue to work normally.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  25. #25

    Default Re: Release of the CUF (font & text rendering) mod tool

    Another release with some more fixes and a few changes in behaviour.

    Bugs:
    • Fix scrolling artifacts by forcing more repaints.
    • Center JavaHelp window properly
    • Fix loading of unit tests on the commandline. (You can tell I used NetBeans to run unit tests directly... )
    • Shells now use each their own PathParser, instead of relying on a globally shared one.


    Features
    • Rewrite of cuf.sh and cuf.wsf to be more flexible. This brings added flexibility in the commandline syntax and allows you to pass in options for the program using the -Doption.name=value syntax. The switches -nox, -gui, -tty and their long form counterparts --no-chrome, --with-chrome, --headless are now simply shorthands for a bunch of such options.


    Misc
    • Changes in how Macros are written to disk: now the code sorts them. This further improves ease-of-use in versioning, as equivalent macro files will end up byte for byte identical.
    • Change in how message strings are loaded from resource bundles, and attending change in program startup logic: now the program attempts to load them through the
      custom classloader (as soon as possible). This is not directly useful for end users, unless you happen to be writing code that wants to let the CUF tool load its own message strings.
    • Add the ability to load XSLT stylesheets from URLs directly. Only available to code extending the XSLTOption class of the CUF tool. This change enables code based on the CUF tool to load predefined “well known” XSLT stylesheets directly.
    Last edited by Tellos Athenaios; 12-07-2011 at 00:06.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  26. #26

    Default Re: Release of the CUF (font & text rendering) mod tool

    Bug fix release, after a report on the TWC:

    Fixes
    • Fix the System font GUI to show loaded Width and Weight settings properly.
    • Fix the System font GUI to not squish the lists under certain conditions
    • Disable the Back button in the first page of the FontWizard GUI.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  27. #27

    Default Re: Release of the CUF (font & text rendering) mod tool

    Almost a year on the CUF tool has accumulated a fair few bug fixes. This release contains:

    Fixes
    • Fix bad key/value counting check when attempting to write empty values to Strings files.
    • Fix possible error when writing empty (null) values using IdentityMapping macro.
    • Fix bad handling of the `?' switch in launch scripts.
    • Fix race in CompileJob between trying to flush pending progress messages and queuing (adding) new ones.
    • Fix race between forked scripts trying to link the same library.


    Feature
    • Launch scripts now allow you to pass the path to the Java program to use, with the `-j' or `--java' switches. This is particularly useful on Windows where Java may not always be on the PATH and trying to invoke it as `java' would fail.


    Misc
    • Move to NetBeans 7.2
    Last edited by Tellos Athenaios; 09-16-2012 at 23:17.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  28. #28

    Default Re: Release of the CUF (font & text rendering) mod tool

    Minor update:

    Tweaked project.properties file so the project builds with Java 7 right away, without need for head scratching. (Culprit: -Xlint:depreciation.)
    Binary only release now contains the Unit tests (and related auxiliary code) by default. This is part of the ground work needed for releasing another tool.
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO