# Custom fonts in Kontakt 6 ?



## geronimo (Oct 7, 2018)

Hi _

After discussion in another thread, I learn that it is possible to raise your own fonts under certain conditions. It interests me a lot but is not easy for me.

To summarize: insert in the Resources / pictures folder an image of this font in .png format _
This image must be fully transparent.
Need to put red dots to the left of each character and 32 blank spaces also delimited by a red dot following the format Window-1252.

I tried to insert a simple and not very original font and the result seems unpredictable.


----------



## EvilDragon (Oct 7, 2018)

Did you fix the things in the font that I mentioned about? Transparent layer needs to be made from fully black color, your red dots weren't fully opaque so that won't work...

Here's another example font:


----------



## geronimo (Oct 7, 2018)

Yes, I have colored the red dots in red (255,0, 0): I compare my image with yours to find my errors.


----------



## geronimo (Oct 7, 2018)

In your example, the first 33 characters are empty: did not I have to put 32 empty characters at the beginning ?
My file ; finaly, he work fine (after edit) ! 

and the KSP code, in my instrument .


```
declare $cfont
    declare $cfont_ID
    $cfont_ID := get_font_id("Regulared")

    $count := 0
    while ($count < 11)
      set_control_par_str(%ui_id_label[$count],$CONTROL_PAR_TEXT,"")
      set_control_par(%ui_id_label[$count],$CONTROL_PAR_WIDTH,53)
      set_control_par(%ui_id_label[$count],$CONTROL_PAR_HEIGHT,16)
      set_control_par(%ui_id_label[$count],$CONTROL_PAR_TEXT_ALIGNMENT,0)
      set_control_par(%ui_id_label[$count],$CONTROL_PAR_FONT_TYPE,$cfont)
      set_control_par(%ui_id_label[$count],$CONTROL_PAR_HIDE,$HIDE_WHOLE_CONTROL)
     
      inc($count)      
    end while
```


----------



## EvilDragon (Oct 7, 2018)

You can have the first 32 characters with dots and empty space after them, or just 32 dots inline, doesn't really matter. Just make sure that 33rd dot HAS some empty space, because that is spacebar


----------



## geronimo (Oct 7, 2018)

Finally, my file does not work again .


----------



## geronimo (Oct 7, 2018)

EvilDragon said:


> You can have the first 32 characters with dots and empty space after them, or just 32 dots inline, doesn't really matter. Just make sure that 33rd dot HAS some empty space, because that is spacebar


Many thanks for this details . In spite of new modifications, the concerned Labels display a change of fonts but one would believe oneself in the "Matrix" film. 

EDIT: I noticed that after saving the instrument (.nki), it is necessary to close KONTAKT and reopen it so that these changes are taken into account.
Would not there be a youthful defect of KONTAKT 6.

Even with your image (Font3), it does not work!


----------



## EvilDragon (Oct 7, 2018)

Font3 does work just fine over here. And the previous font I sent.


----------



## geronimo (Oct 7, 2018)

Font3 at home .


----------



## geronimo (Oct 7, 2018)

And with Font 1 ! I must omit something else ...


----------



## EvilDragon (Oct 7, 2018)

Hm, no idea.


----------



## geronimo (Oct 7, 2018)

Your example (Dynamic Fonts demo) work fine at home: I must find out what's bothering me !

Edit: after edition in the KSP text, I realize that it's necessary to save the instrument then to reload it so that the modifications, change of fonts are taken into account.
My personal font files were incomplete and could not work .


----------



## EvilDragon (Oct 7, 2018)

You might not need to reload the instrument. But graphics aren't refreshed when pressing "!" to reset the audio engine - that just resets the audio engine and reinitializes the scripts. Pressing "Apply" button in any of 5 script slots reloads the graphics.


----------



## geronimo (Oct 7, 2018)

Many thanks for this other precision and for your patience. I thought it would be easier to build a font in .png format.
It's a hell of a job.


----------



## EvilDragon (Oct 7, 2018)

Yeah it's not easy, but the benefit is huge. It's been a long standing request, now we finally have it.


----------



## geronimo (Oct 7, 2018)

So then, just enlarge the fonts in .png format to accommodate them in labels with the right dimensions ?
But I think I have to dream a little bit and it does not work that way .


----------



## P.N. (Oct 8, 2018)

Only now i'm seeing Kontakt 6 has custom fonts! That's really cool. 
I'm reading there are some limitations and i wish NI could have implemented native TTF support, but i can only imagine that would be extremelly diffcult or impossible.

Any more interesting findings regarding this? Size limitations, etc?

When i update to version 6, i will be doing some research/testing myself and probably convert some free fonts to the new format.

It might just be a matter of knowing the image requirements and come up with an automated way via actions, or photoshop/after effects scripts.

From what i'm seeing, the red dots are aligned with the first pixel of each character and there's one pixel of spacing between each character. Anything else?

Paulo


----------



## EvilDragon (Oct 8, 2018)

P.N. said:


> i wish NI could have implemented native TTF support,



It's not impossible, but it's a licensing/distribution nightmare when payware fonts are concerned, so it won't ever happen. This is a better way of dealing with it, because you can use payware fonts in this way without any licensing nightmares.



P.N. said:


> From what i'm seeing, the red dots are aligned with the first pixel of each character and there's one pixel of spacing between each character. Anything else?



As mentioned in another thread: The red dots need to be 100% solid/opaque (255, 0, 0), transparency needs to be made from a fully black layer (0, 0, 0), and you have to conform to Windows-1252 codepage (as you can see in the font I posted above, those are all the characters - first 32 characters are control symbols, so these must be empty, but red dots still have to exist).


----------



## P.N. (Oct 8, 2018)

About the TTF, yeah, I'm sure they had a very good reason for this.

Regarding the format:
I understood the dots color, 32 red pixels in the beggining and the order they should be rendered.

I was wondering about how the dots relate to the characters. They seem to be there as a mark for each character.

In that case, changing the font size should also mean changing the dot's spacing so each dot matches the character it delineates.. But i wonder if there needs to be a well defined space between each character as well.

And what's the vertical spacing between the dots and the characters that should be maintained? Your example seems to show that there doesn't need to be any spacing (some characters are "touching" the dots).

Can we assume that the dots are there precisely to create the boundaries that Kontakt uses to get the correct image and they're the only real factor to consider when creating correct fonts?

I apologize if this was answered already. I'm just trying to see if there are other limitations (the image size) when creating larger font files. This will result in larger images, but, oh well. 

Paulo


----------



## EvilDragon (Oct 8, 2018)

P.N. said:


> They seem to be there as a mark for each character.



Bingo!



P.N. said:


> But i wonder if there needs to be a well defined space between each character as well.



Yes, have 1 px of space between characters so they separate nicely when you type them one after another. Might need to be 2 px with larger font sizes... this is up to experimentation.



P.N. said:


> And what's the vertical spacing between the dots and the characters that should be maintained? Your example seems to show that there doesn't need to be any spacing (some characters are "touching" the dots).



Yes there's no need to have any spacing, red dots are just delimiters. But at least make sure that the red dot is not _overlaying _the actual letter.


----------



## P.N. (Oct 8, 2018)

EvilDragon said:


> Bingo!



 Ah, come on, it's the first time i'm looking at this thing...

I was hoping the horizontal spacing could remain constant - size of the character plus 1 pixel would make it easier to create a template for generating the font...

I'll do some tests when i get the update.

Thanks, man.

Best regards,
Paulo


----------



## Lindon (Oct 8, 2018)

..still no kerning tho..


----------



## EvilDragon (Oct 8, 2018)

That's not really a problem. A well done picture font doesn't need any kerning adjustments.


----------



## geronimo (Oct 8, 2018)

Well, I did well to open this topic !


----------



## P.N. (Oct 8, 2018)

Lindon said:


> ..still no kerning tho..



But proper kerning is not as straight forward as just choosing a spacing value...



EvilDragon said:


> That's not really a problem. A well done picture font doesn't need any kerning adjustments.



That's what graphic designers do. Proper kerning requires time and patience.
Depending on the font and size there are always small adjustments to be made...
It's probably my least favorite aspect of logo design (some people love this).

But it will depend on how much spacing between each character Kontakt allows.



geronimo said:


> Well, I did well to open this topic !


Yup.


----------



## EvilDragon (Oct 8, 2018)

P.N. said:


> But it will depend on how much spacing between each character Kontakt allows.



Any number. It's aaaaaaall about the red dots, man.


----------



## P.N. (Oct 8, 2018)

Ah, so when you were saying before "1 or 2" pixels of spacing, you were refering to potencial kerning adjustments, not Kontakt limitations.
Alright, i think i finally got this. 

Paulo


----------



## Lindon (Oct 10, 2018)

EvilDragon said:


> That's not really a problem. A well done picture font doesn't need any kerning adjustments.


you are like joking yes? 
I spent years as a font designer - "no need for kerning in a well designed font?" - I SOOOOOO wish that was true.


----------



## Lindon (Oct 10, 2018)

P.N. said:


> Ah, so when you were saying before "1 or 2" pixels of spacing, you were refering to potencial kerning adjustments, not Kontakt limitations.
> Alright, i think i finally got this.
> 
> Paulo


OK so I DONT understand this then... but first lets get a definition out of the way:

Kerning - the space between a pair of letters when run together so the space between AV is different to that between EV, font design requires careful consideration and specification of kerning values for "kerning pairs" 

given the above how does this "red dot" solution fix this ?


----------



## EvilDragon (Oct 10, 2018)

I'm not joking (at least not consciously/deliberately ). Obviously with picture fonts you can't really have kerning adjustments with different letter pairs. This is not vector fonts so kerning cannot apply, simple as that.

Basically what we got here is just stuff that Kontakt uses internally to show text exposed to KSP. That's all. Don't expect TTF/OTF support to ever happen, it probably won't (due to previously mentioned licensing/distribution can of worms).


----------



## P.N. (Oct 10, 2018)

Lindon said:


> OK so I DONT understand this then... but first lets get a definition out of the way:
> 
> Kerning - the space between a pair of letters when run together so the space between AV is different to that between EV, font design requires careful consideration and specification of kerning values for "kerning pairs"
> 
> given the above how does this "red dot" solution fix this ?



Sorry. I got messed up by the previous posts about kerning.

What i really meant to say after was:
"So when you were saying before "1 or 2" pixels of spacing, you were refering to potencial image adjustments, not Kontakt limitations/requirements."

The spacing and dots won't allow kerning can but give you some headroom so that you can try and make the general appearance of the font more balanced.

The best course of action is choosing a "good" font first.


----------



## Lindon (Oct 10, 2018)

EvilDragon said:


> I'm not joking (at least not consciously/deliberately ). Obviously with picture fonts you can't really have kerning adjustments with different letter pairs. This is not vector fonts so kerning cannot apply, simple as that.
> 
> Basically what we got here is just stuff that Kontakt uses internally to show text exposed to KSP. That's all. Don't expect TTF/OTF support to ever happen, it probably won't (due to previously mentioned licensing/distribution can of worms).


yeah so - its better than it was but its still not HISE on the fonts front.


----------



## EvilDragon (Oct 10, 2018)

Hey if ya need HISE features then use HISE, I suppose.  JUCE is making a ton of things easier there.

How's font licensing/distribution handled there?


----------



## P.N. (Oct 10, 2018)

This turned into a Kontakt vs HISE thread? Where's David?


----------



## Lindon (Oct 10, 2018)

EvilDragon said:


> Hey if ya need HISE features then use HISE, I suppose.  JUCE is making a ton of things easier there.
> 
> How's font licensing/distribution handled there?


David will be here momentarily....oh hang on he's over answering q's on the HISE forum... 

Font licensing: Here's an interesting thing....one of the few copyright IP rulings ever made in a US court said --- you cant copyright a typeface. Yeah really... as a font designer(previous life) this was a PITA. Of course there's the moral issue - but licensing I think in HISE is "left up to the persons(developer) embedding the font" but given the amazing explosion in free fonts I think the licensing issue is probably a bit of a diversion...


----------



## EvilDragon (Oct 10, 2018)

That's just US court, but it'd need to be accepted precedent anywhere else in the world too before you could freely distribute the font I suppose? (I am no lawyer, I'll admit, just going by logic here.)

I guess with HISE it's a bit different situation since it's open source, but since NI is closed source, you can't easily shift the "blame" to the 3rd party developer, if there's a legal issue with fonts, they'd come after NI. And they probably want none of that - which is understandable.


----------



## P.N. (Oct 10, 2018)

There's also the difference between copyrighting a typeface or a font file.
That's the reason we have different companies selling different fonts from the same typeface.


----------



## Mike Greene (Oct 10, 2018)

Lindon said:


> Font licensing: Here's an interesting thing....one of the few copyright IP rulings ever made in a US court said --- you cant copyright a typeface.


Wow! That sounds like a bad ruling to me. I could understand certain typefaces being considered so generic that copyright wouldn't apply, but there are a lot of very creative typefaces out there that IMO deserve copyright protection. I happily paid the license for my Realitone logo, for instance.


----------



## Lindon (Oct 11, 2018)

P.N. said:


> There's also the difference between copyrighting a typeface or a font file.
> That's the reason we have different companies selling different fonts from the same typeface.


so if you use one of these fonts in your product, which of the vendors should be talking to you? See the problem?


----------



## P.N. (Oct 11, 2018)

Lindon said:


> so if you use one of these fonts in your product, which of the vendors should be talking to you? See the problem?



It's not a problem for me - i'll be using Kontakt... (just kidding). 

Above you seemed to be talking from a designer's perspective.
In that case, since you can't copyright the typeface in the US, you, as the designer, should also take the role of distributor of the font.
You may also copyright the name. You're protected in that regard, at least.
Sure, the US Court has somehow underappreciated the artist's role in creating the design, but he still has options to be compensated for his work, even if it's selling font licenses for it.

As a software designer that wishes to embed a font in your product, you only need to buy a specific license.
If i decide to use a font in a logo, in a vector or raster format (no embedding), i may require a different license.
Sometimes, the licenses overlap different scenarious.
That's all up to the vendor, but if you have your licenses in order, you should be fine.

Did you personally experience an issue with this?


----------



## Lindon (Oct 14, 2018)

P.N. said:


> It's not a problem for me - i'll be using Kontakt... (just kidding).
> 
> Above you seemed to be talking from a designer's perspective.
> In that case, since you can't copyright the typeface in the US, you, as the designer, should also take the role of distributor of the font.
> ...


As a font foundry yes we did, but the realities are trickier than you think. I realise this is getting WAAY off topic here. 

So you cant copyright a typeface, but of course you can copyright your implementation of it (a font here,or more simplisticly a piece of software that renders some shapes). If you think about it this actually makes sense. Lets say we live in a universe where I can have exclusive licensable rights to a typeface...I get you to write out the alphabet, and the numbers... I scan these and turn them into a typeface. Which I copyright. OK now every time you write something down(in your normal handwriting) you owe me...

This is an obtuse example - but its useful to demonstrate why the US courts made this ruling, typefaces, by the definition we currently use - are ubiquitous - no one can own them. Fonts not so much - BUT as a consequence that anyone can use any design(typeface) in their implementation(font) we end up with the same (classically great) typefaces in many many implementations - and when one such implementation is embeded in a product like in a Kontakt interface(phew got Kontakt into this post) then its not possible for any given owner of a font that implements that typeface to know for sure that their implementation is the one being used in the product. Effectively making it impossible to enforce copyright. Which is why NI are being a bit over cautious in my view.


----------



## P.N. (Oct 23, 2018)

All fair points. Debatable, but fair. 

I don't design fonts, so my only experience is as a font buyer.

In that regard, i've never had issues, though it's important to reference that i don't redestribute (embeded or not) commercial fonts in any kind of graphic work i do.

About NI and their implementation, sure that's a solid argument.

For the programming aspect of it (what it would take to actually implement ttf or otf), i don't posess enough knowledge to comment on that.


----------



## Lindon (Oct 26, 2018)

P.N. said:


> All fair points. Debatable, but fair.
> 
> I don't design fonts, so my only experience is as a font buyer.
> 
> ...


..prob ask Christoph


----------



## P.N. (Nov 1, 2018)

I don't know who Christoph is... 

That level of programming is most likely beyond what i'm able to understand at this time.
My knowledge is restricted to Kontakt (or basic scripting in audio/video applications).

We've certainly hijacked this thread, haven't we? 

Cheers


----------



## Lindon (Nov 2, 2018)

sorry

"For the programming aspect of it (what it would take to actually implement ttf or otf),"

- Christoph is the developer of HISE which implements these


----------



## Artem (Nov 26, 2018)

Hi there guys. I was looking for info about Kontakt 6 dynamic fonts update, and was really pleased with this thread, thanks to all who participated.
Can someone please confirm/decline the next statements:
1. We can vary the height size of this font, in this thread, I only find 13 and 15 px height images, so is it restricted?
2. We can use a custom color?
Best Regards!


----------



## P.N. (Nov 27, 2018)

Hi, Artem.

I didn't try the new Kontakt 6 fonts myself, but i'll try to answer this:

1. Probably only depends on the red dots. If you align everything correctly, other sizes should work.
2. It's an image based system, so any colour should work. There's the question if a red font that matches the dot colour would cause any issues, but i'm guessing no.

Paulo


----------



## Artem (Nov 27, 2018)

Hi, Paulo!
Thanks for Your answer, really appreciated.
Few words, if it works it's really good, I used to animate values text in AE, so its baked with slider or knob file. Having those kinds of animation, I think give a unique touch to UI (stand out from other (generic) interfaces)
I know I ask too much  but maybe you know if the default Kontakt fonts were updated? Maybe new colors etc. Thanks!


----------



## P.N. (Nov 27, 2018)

Sorry, i don't know how if Kontakt 6 fonts were updated.

I agree with you on the potencial.
Effects can be added into the fonts, specially effects that could be CPU intensive if rendered in real time, like glows, depth of field, etc. - which is something Kontakt doesn't allow anyway.
On top of this, shadows can also be added without the hassle of having 2 labels, with different fonts, stacked on top of each other (offset by a pixel - x and y axis).

Having the ability to bake all this into the font's images may lead to interesting results.


----------



## Artem (Nov 27, 2018)

Thanks anyway.
Yeah, will see, nice update!


----------



## EvilDragon (Nov 27, 2018)

Artem said:


> but maybe you know if the default Kontakt fonts were updated? Maybe new colors etc.



Nope.


----------



## audiogamble (Jun 19, 2019)

@EvilDragon - Perhaps you can shed some light on an issue I'm having with the custom fonts. A graphic designer had generated a font for an instrument I'm building. This font currently works, with the exception of a few pixels from adjacent characters slipping into the wrong frame. Unfortunately, the original PSD files do not exist for this font, otherwise we would just have the graphic designer move the red dots to correct this. 

In theory, if the initial font works then shouldn't we just be able to load the png into photoshop and move the red dots to where we need them? I've tried this, and the font looks completely jumbled and wrong after re-saving. Is there any specific tool or exporting method that needs to be used that anyone here is aware of?


----------



## EvilDragon (Jun 19, 2019)

Good questions.

First, your PNG needs to have 256 red (255, 255, 255) dots, precisely. Not more, not less. The easy way to check this is to do a non-contiguous selection with the eyedropper tool and go to Histogram view, it will say how many pixels the current selection is (ofc, I'm implying Photoshop here).

Also, you have to absolutely make sure that the position of red dots doesn't allow bleeding one character into another. Yep, this is quite tedious to edit, but yep, you gotta do it.

Then, grab SuperPNG addon for Photoshop, and use it for saving out PNG files you create. Make sure that "Clean transparent" option is ticked. That should do the trick. It's very important that the alpha layer in the PNG is nulled this way, and Photoshop doesn't do this by default.


----------



## olmerk (Jul 6, 2019)

And ui_file_selector still can not be customized with this method?


----------



## EvilDragon (Jul 7, 2019)

Nope, not yet unfortunately.


----------



## olmerk (Jul 8, 2019)

I'm trying to incorporate a custom font. The scripted piece for that works fine with one of pngs provided by EvilDragon. However as I use my own png the letters are messed up and crammed like the spacing is not used at all. I'm attaching both - my png and the working one. Where could be an error? At least the beginning of both character pictures are marked the same with the red dots...


----------



## EvilDragon (Jul 8, 2019)

Do you have exactly 256 red dots? It will not work if otherwise. And also, are you using SuperPNG to generate a nulled transparent layer for the PNG (as I explained above)?

EDIT: Yep, you have 255 pixels in that PNG. This is easy to check in Photoshop's Histogram, after you magic wand the red pixels.


----------



## olmerk (Jul 8, 2019)

EvilDragon said:


> Yep, you have 255 pixels in that PNG


 Fount it! I missed one character. 

So how to select in Photoshop all red pixels at once rather than shift-click with Magic Wand one by one to check the summary in the histogram?


----------



## d.healey (Jul 8, 2019)

olmerk said:


> So how to select in Photoshop all red pixels at once rather than shift-click with Magic Wand one by one to check the summary in the histogram?


If I remember correctly magic wand can select non-continuous pixels, you just have to change the mode.


----------



## EvilDragon (Jul 8, 2019)

Yes, disable the contiguous selection option.


----------



## soundtrax (Sep 6, 2019)

Is there a max. height for these custom fonts? I tried to modify one of your font PNGs in your 'dynamic font demo' NKI, but everytime I increase the height of the PNG the type will be cropped in Kontakt.


----------



## EvilDragon (Sep 6, 2019)

Yes there's a bug in Kontakt whereby if the dimensions of the PNG change, it doesn't get updated properly in Kontakt and you have to restart to see it updated. It's reported already.

Other than that, you can use any height you want, it's a bitmap. All that matters is that the red dots are correctly positioned, and that there are 256 of them.

Use Blake's tool for custom font creation: http://www.syntheticorchestra.com/kontaktfont/


----------



## soundtrax (Sep 6, 2019)

Thanks for the heads up! And I didn't know about this cool font tool...fantastic!


----------



## BobBeck (Sep 22, 2020)

EvilDragon said:


> You can have the first 32 characters with dots and empty space after them, or just 32 dots inline, doesn't really matter. Just make sure that 33rd dot HAS some empty space, because that is spacebar


Hi, I'm super new to this and am a Graphic Designer working on a custom library interface with a friend, so my apologies in advance if my questions sound stupid or rudimentary.

I understand the custom font formatting in general, but am looking for more specifics and how the file build affects the font's spacing (both between letters, and between multiple lines). I am wondering if the placement of the red dot in relationship to the top of the font character has any bearing on interline spacing (what I call leading). 

In the sample font (REGULARED) you guys have posted, there seems to be a 1 pixel gap between the top of the tallest character and the row of red dots (I know these should not overlap). Most characters fall under this, but the worst offenders - with some anti-aliasing - leave just 1px. 

On the bottom, the least amount of space is 2px - with most of the baseline leaving around 3. 

Would these gaps affect interline spacing (i.e. when there are multiple lines stacked on top of one another?)

Thanks in advance for your consideration and advice! 
Cheers, Bob


----------

