What makes this problem tricky is that you don't just have the sum of a triangle wave and a square wave. The negative steps of the square wave are -12 V, but the positive steps only +8 V.
Trying to create the final signal as a composite of several signals as Steven and Oli suggested is perfectly valid and may in fact be the best answer. However, here is a different way to think about this problem.
Consider a capacitor that can be charged and discharged with fixed currents, and can also be clamped high and low "instantly" to +8 and -8 volts. Just to pick something, let's use a 10 nF capacitor for example. To discharge it by 4 V in 1 ms would require -40 µA. To charge it 8 V in 1 ms would require +80 µA. You could have separate -40 and +80 microamp sources that are enabled at the right time. However, it's probably easier to to have a fixed -40 µA source and a switchable +120 µA source.
Everything can be driven from a 500 Hz square wave. the 120 µA current source is enabled when the square wave is positive (during 1-2 ms and 3-4 ms in your diagram). The low side clamp is enabled for a short time from the rising edge of the square wave, and the high wide clamp from the falling edge. Since the voltage is reset to one of the clamp limits once per millisecond, this method nicely avoids runaway if the steps and ramps don't add up to exactly zero per cycle.
This is not a schematic, just a diagram of the general concept. I have NPN and PNP transistors for the clamps only to show the general idea. There would be more required, like a diode and/or resistor, to reset C2 and C3 in time for the next use if bipolar transistors are actually used. Current sources can be created with opamps, and there are various ways to switch one on and off.
Again, this is a concept only with the details left as a exercise. However, I think this could be workable depending on a lot of stuff you haven't told us, like accuracy, output drive, speed of the edges, etc. I could get into more specifics if this is a direction you are interested in.