This is more complex. Please read the Naming tutorial.
You can put the info in the font but practically no software out there supports it. InDesign claims it does but it doesn’t. You can control it with a custom parameter in Font Info > Instances called Optical Size. From the handbook:
Builds the Optical Size OpenType feature (feature tag ‘size’), with encoded size menu names for Mac and Windows. Requires a string with five semicolon-separated values:
• design size: size in decipoints (tenths of points) the font was designed for;
• subfamily identifier: arbitrary integer; different fonts with the same number can be grouped together in an optical size submenu, if the software supports it;
• range start: decipoint size of the size above which the font is supposed to be used for;
• range end: decipoint size of the size until (and including) which the font is supposed to be used for;
• size menu name: submenu name for the optical size, e.g., ‘Display’, ‘Subhead’, ‘Small’, or ‘Caption’.
Example: ‘100; 1; 69; 120; Ten’ will create a size feature that specifies 10 points as the intended design size, the range in which it is supposed to be used is 7 to 12 points, and the optical size name is ‘Ten’. Other fonts that use 1 as subfamily identifier and ‘Ten’ as name, can be grouped together.
Unfortunately its not working: cached cleaned, installed in adobe’s folder, exported with different name.
Update: Fixed it by deleting the parameter [localizedFamilyName & Designer] from the font custom parameter - what is the connection between them? why it interfere?
I did everything correctly according to the tutorial - still not working correctly .
Make sure you avoid all cache problems or font conflicts (two fonts with conflicting naming), perhaps best to try with a completely new family name. Make sure all fonts involved support the Win1252 character set. Make sure set the style linking properly.
If you still cannot get it to work, please send me the .glyphs files.