Jump to content

CnCNet Forums

Search In
  • More options...
Find results that contain...
Find results in...

Westwood Font Editor [Development thread]


Nyerguds
 Share

Recommended Posts

v1.5 released.

Pasting images into the editor works now! How they come out depends entirely on the palette you got selected, since it'll match the pasted content on the palette as closely as possible.

A little test with the editor's own icon: (I temporarily changed the first palette color to black to do the paste for this)

fonteditor_18_paste.png

Other features include:

  • Changing the font type
  • A global color replace function
  • ctrl+arrow keys as shortcuts for symbol image data shifting, with ctrl+shift+arrows acting as global shifting of all symbols on the entire font. You may need to click in the main editor area for this to work, as it's disabled on controls that use certain of these shortcuts themselves (like text fields and the grid listing the symbols)
  • A right-click menu on the preview image to copy the image on it to the clipboard.
Link to comment
Share on other sites

Aaaand 1.5.1 released. Derp.

I messed up the paste logic; it tried to take image data before actual font data. Since copying a font symbol copies it both as font symbol data and as image, that means the paste logic never still used the font data version, and so the pasted stuff not only became palette-dependent (with a possibility of messing up colors, especially if that palette had changed), but also lost its Y-offset :dry:

[edit]

1.5.2 released: added some much-needed close confirmation, and finally implemented conversion logic into the "save as" dialog, so you can select the type to save as from the types dropdown list.

Not that I advise that, though; conversion usually needs some more touchups you'll need to do in the editor anyway :P

Link to comment
Share on other sites

Fixed a bug that corrupted the clipboard when editing palette colour #0.

 

So, apparently some rogue programmer at Microsoft in the time of the Windows Vista development thought it was a good idea to make double-clicking a Label copy its text to the clipboard. If you're wondering, I use Labels with a background colour set to build up the colour palette.

 

And it was done in such a half-assed way that the fix for it was pretty dumb, too.

Link to comment
Share on other sites

Yup. I actually thought it was the colour picker at first, and was kind of baffled by the fact it didn't seem to happen every time. Then I noticed that when I tried to paste the contents of the clipboard in various programs after the 'corruption', that, when pasted in MS Word, it put a "T" in the document.

Which is the little "Transparency" indicator the palette picker puts on colour #0. :huh:

In other words, it only does it when there's text on the label. The bafflingly stupid fix for it was apparently to make my own Label class which was derived from the original MS Label class, but which had its own new public "Text" property, overriding the original one. The whole Windows UI system adapted to that flawlessly, using the new offered Text stored in my own class... but that clipboard copy logic still seemed to use the internal one in the underlying "Label" itself, which was now never filled in. So yea, whoever did that thing did it in a really hacky way that didn't even use the normal publicly accessible data of the Label object.

(Another weird detail: when pasting the contents in Gimp after that "corruption", the image itself still appeared, despite all programmatic analysis done on the clipboard objects at that point assuring me there was no trace of any image data on the clipboard. Wut. Now I'm really wondering how Gimp accesses the clipboard O_o)

Link to comment
Share on other sites

  • 3 months later...

Fixed a couple of bugs in this, and released v1.5.6.

If you copy a symbol using ctrl+c or the menu, you can now also paste the character as text (as shown in the sidebar, according to the currently chosen text encoding) in text applications.

Seems like a little thing, but when dealing with these Cyrillic letters I really want to open these in something where I can take a closer look at them, lol.

Link to comment
Share on other sites

A couple more micro-releases later, I'm at 1.5.9, lol. Actually using this on a project sure brings a lot of bugs, missing features and little usability nuisances to light.

  • Fixed a crash in the previewer when one of the previewed characters is the last character in the font.
  • Fixed a bug in the font size changing that made it change the wrong dimension (which in turn led to crashes as the symbol size dimensions on the UI tried to adapt the wrong way).
  • Fixed the internal assembly name; it was still "CnCFontEditor".
  • Added shortcuts for "safe" image shifting, expanding the image to the shifted direction (with support for bulk changes)
  • Added shortcuts for changing the Y-offset (with support for bulk changes)
  • Holding down Ctrl now enables colour picker mode, for fast color picking.
  • Optimized refreshing of paint mode and color pick mode.
  • Colour picker now shows a hand cursor.
Link to comment
Share on other sites

  • 2 weeks later...

This still needs a little more development, but it's a feature I've wanted in there for a looong time; a manager for the palettes, which gives the ability to save edited palettes to a new entry on an external file.

fonteditor_19_pal_edit_1.7.0.png

This can do full management of the palettes, except for one detail: you can't rename the actual palette files. You can name them when creating them, you can delete them, but if you want to rename them, just go and find the files on your disk :P

Link to comment
Share on other sites

Thanks!

I got a new and really cool feature in the making, namely, pasting from clipboard with transparency support. This means that you can actually combine stuff, albeit in a somewhat rudimentary way; you can't really choose the position where it pastes except by adjusting what you copy. But you can get around that by editing / shifting / cutting out the stuff you want to copy in the editor, then copying to clipboard, and then just reverting the symbol you messed up by doing that ;)

Specifically, this it should make it much easier to add diacritics on characters that already exist.

I think I'll separate the options as "paste as symbol" and "paste on symbol".

Link to comment
Share on other sites

  • 3 months later...

I released a new version with better transparency support.

There is one big problem with the Windows clipboard: it does not have transparency support. Now, you may think, "hey, but application X I use handles that fine!" Yes, well. The standard image format on the clipboard doesn't have transparency support. But there are more options.

See, the clipboard can contain multiple objects simultaneously. When a symbol on the font editor is copied, it's not just in there as image. It's in there as image, as FontFileSymbol object of the font editor itself, and even as text character. So what these applications do is simple: they add it to the clipboard in more formats, and they support reading these extra ones.

A classic one seems to be png. A lot of applications, including MS Office and Gimp, support pasting that, with its transparency intact. But, when I filled the clipboard with the combination of standard clipboard image format and png, and pasted it into Chrome to upload it into Imgur, it took the nontransparent one, so apparently it can't handle the png version. Neither did I get a png image out of Chrome when I copied an image from the browser.

That's when I discovered the "device independent bitmap" (DIB) format. It's apparently another somewhat-standard way of putting an image on the clipboard.

However, according to its specifications, the type of DIB that Chrome put on the clipboard is 32-bit RGB. This means that while each colour is saved in 4 bytes, the 4th of those is not supposed to be read, and the format has technically no transparency. But it seems Chrome completely ignores that, and uses the format as ARGB. Just test it out; an image with transparency copied from Chrome and pasted into Gimp does not retain its transparency, because Gimp handles the format correctly. Meanwhile, that same image copied from Chrome and pasted into Imgur in Chrome will be uploaded with its transparency intact.

So in the end, I had no choice but to support this bastard-DIB format, because apparently reality is a lot less elegant than any specification. Yey X_x

 

Link to comment
Share on other sites

The mess with transparency just got kicked up a notch...

Apparently when you press Print Screen on a (Windows 10) desktop made of 2 screens with different heights, the resulting image is actually put in the clipboard by Windows itself as that bastard DIB format with transparency in it; the area under my smallest screen is transparent, not black.

GOxnaJj.png

This was saved through the font editor's clipboard code. When pasted in Gimp, the area underneath the left monitor image is, again, black, as it should technically be according to the DIB specs.

Link to comment
Share on other sites

  • 9 months later...
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Similar Content

    • By Nyerguds
      Over at TiberiumWeb, Lin Kuei Ominae has been doing some very interesting experiments with triggers, and has come up with some neat ways to do stuff like making an AI-owned MCV move to a spot and deploy there, making reinforcements arrive on the Nod airstrip, and making a trigger to give a player money. I suggest you check it out
      http://www.tiberiumweb.org/forums/index.php?showtopic=3743
      Mind my replies though; Lin Kuei did make a couple of mistakes
    • By [Spro]Sin
      Air is over powered in red alert 1  
      also anti air is under powered in red alert 1 
       
      This has been a problem for long time but has become more clear too me over time when i changed from being a base builder too a tanker 
       
      In the game red alert 1 we have many maps and 2 main play styles 
      Tanker players and base builder players
      i get straight to the point and explain everything 
       
      air units are by far the best in the game also there the most hated least fun and only take away good games from players 
      air only good for trolling or for being a one trick pony or cheap wins air dumb the game down a lot 
       
      why is air so over what makes it this way 
       
      its because unlike any other units in the game air can go any where on the map fly over any defense and kill any building but army stuck on the land and navy stuck in sea  
      the next thing i need point out is only few units can even defend them self vs air 
      ok sure what about run away wait cant to that air faster too 
       
      how about kill mcv power it only air air units kill a mcv no matter where it is on the map no range limit too air that is are strongest building a tanker player cant rebuild mcv after this 
      ive been on both sides of this many 2v2 games one sided because cheap win or get teamed up on by 2 pros when am trying do right thing but lose because ally trolls 
      3v3 games often turn into 2v3 games for long time because this too 
       
      base builders even they are not safe a few good hotkeys with air and bookmarks and spam that build button u can take out up too 10 mcv at a time 
      full base gets leveled ever 3-5 mins even with huge anti air  all one type building dead mcv or ore ref most the time 
       
      i played few games op air players they built about 300-400 places in 30-50 mins i looked at stats after game 
      also it didnt matter how many sams rocket soldiers i made waves of air can attack with out it mattering how many die they just build x2 more most game aways turn into this mcv death rebuild build sams rocket soldiers 
       
       
      war tank players out right ban air from there games but air also just op on all maps 
      also tanker base builds dont want because of air 
       
      i was used not mind till too many players used air and how op it is
       but the fact that too many players spam air attack become stuck at this level of play poor play style  don't learn better skills 
       
      u can learn play the game any way u want in your own room this post not shame air players say there not pro 
      there some good players that only play custom mod maps that got good at this am even ok with rigged games as long as the players are open with what they are doing do so in the room they are the host off just playing for fun of it
       
      I want some kind of fix too this air problem 
      The best fix i think is add a button so players can just turn air on or off in room host settings 
      that way the mod maps in red alert 1 that need stats too stay the same will not get messed up by any fix is made 
      another fix just weaken air [by a lot] and make stronger anti air  stronger [by a lot too as well also units need be able fight back vs air not be helpless}
      maybe build build limit be good i also think mod maps hurt less by this kinda change if it was too happen 
      or even range limit 
       
      but a air on or off button be by far the best for everone not doing anything about this me anti air players suffer in a game they don't like and just put up with and the players who aways use air on them 
       
      i just want everone be able play the game how they want too 
      it be so much easyer on everone if we can make it so both sides can have the game how they want it too be played in there rooms best done with settings just asking for no air players don't listen also no way stop them other then ban them from room after game 
       
      players who like air should play with others who like air 
      players who hate air like me should play others of are own kind be able have a clean air free game when is asked of the players 
       
      guys be friendly its ok like air games just dont force it on me 
      just because i don't like air u might or might not like air don't stop us from being friends everone has there point of view 
       
       
    • By sgtmyers88
      EDIT: The new mod profile is live!
       
      So long time no chat. lol 😀 Since finally completing the story campaigns for Tiberian Dawn Redux a couple years ago I have been repeatedly approached about carrying the mod over into the RA universe with a spinoff. While it's still in the very early stages of development, Red Alert Redux is slowly being brought to life. I haven't decided if it will be a mini-mod type add-on built into TDR (think GDI/Nod vs. Allies/Soviets in skirmish) or a standalone project built off of the renovated C&C Generals SAGE engine TDR is now using. I know a lot of the assets and coding between the original TD and RA games is nearly the same so it would streamline development quite a bit. (looking into the original game files I noticed a lot of the art and audio assets are using the same filenames to confirm this) The biggest hurdles I have will be making a decent naval system, designing, coding, and animating attack dogs and then the Chronosphere stuff. I may also (as I did with TDR) consolidate the unit and structure tech tree and add unit upgrades and special abilities. (e.g. Engineers doubled as Mechanics and APC's doubled as Medics) So who wants Red Alert Redux? And I will say it will not be a 1:1 remake. As I did with TDR I aim to keep as much of the original wacky tech and atmosphere Westwood developed for TD and RA but also have a more realistic spin on it in both appearance and gameplay. I have been considering consulting with the former Cold War Crisis Mod Team and the guys behind Red Alert: A Path Beyond.
       
       
       



    • By XMaDTanKX aka T-90
      Hello
      I'm doing some video stuff with Yuri's Revenge and every time I try to open the XCC Sound Editor that comes inside the XCC Mixer, the program just closes itself and won't let me do anything. I only need to extract some audios from langmd.mix\audiomd.mix\audio.bag as wave files to put them into a video.
      I'm using XCC Utilities 1.47 and surprisingly with older versions like 1.12 or 1.40 the issue won't happen, but I can't read Yuris Revenge, only Red Alert 2.
      Any idea of what could be causing this and any solution?
      Thanks in advance.
    • By Insurgent
      Hello, i've just played minutes ago, but after restarting my pc this came out when i tried to open cncnet-yuri's revenge.
      Can anyone give me some hints so I can solve this problem?
      Kind regards.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...