Those linear encoders are not really fit for direct use with (industrial) servo motor controllers.
The motor controller needs signals that are n phase with the rotor position and their magnetic fields, and when you go through couplings, backlash, thermal expansion and other error sources the motor controller may get confused if you use the feedback from anything else then something directly connected to the motor shaft. Those industrial servo motors also have encoders directly on the motor shaft.
The linear encoders are normally used with an extra control loop to compensate for the error mentioned earlier, as the user is interested in the final position of the linear movements, and not in the position of the motor shaft itself.
If you have severe budget constraints, then have a look at the stuff from Ebay / Ali / China. Some time ago I bought a set of two readout boxes and 5 linear scales (Mill & Lathe) for around EUR500.
The STM32 (and probably other uC's too) have hardware support for 2-bit gray input code. With such a uC it should be a breeze to make your own read-out box. Others have also already done such things and you can find projects on sites like github.
I have not even considered looking at Heidenhain or Renishaw. I would not expect their prices to be anywhere near something decent or realistic.
In the last 10 years or so, encoders that are built into the linear bearing rails are becoming more common. Even manufacturers such as Hiwin have these in their assortment, although a lot of dealer that sell (genuine ) Hiwin, do not by far have the whole assortment that Hiwin makes.
The cheapest would be those capacitive rules, that look like (and are) calipers without the beaks. These apparently do not have a very good reputation. The only experience I have... Well. I bough a bunch of those cheap calipers and I threw them all in the garbage bin. Several of them were even unused an new in pcakagings. Instead I coughed up EUR 100 for a 150mm Mitutoyo, and that one just keeps on working.