The approach that they use proceeds something like this.
1. Convert quality/service membership to tip membership.
Since quality and service have no membership in the "bad"/"poor" category, there is no membership in the "low tip" category. There is .04 membership of service in the "acceptable" category, which translates to .04 membership in the "medium tip" category. Finally, quality has about .3 membership in the "great", but service has .96 in the "amazing" category. In their fuzzy logic scheme, they use Max in place of OR, so this translates to .96 membership in the "large tip" category.
2. Fill each tip category up to the height of their membership.
This is what is displayed in the last figure of the linked documentation. 
3. Create a single distribution by taking the OR (Max) of the membership.

4. Find the centroid of the distribution
They mention in the link shared by Abdullah in the comments that this isn't the only way to "defuzzify" the results, but it's what they do here. I don't know how this is implemented in the code, but it can be (roughly) determined using the following formula in this case.
$$\frac{\int xP(x) \,dx}{\int P(x) \,dx}=\frac{\int_0^{13} 0.04x \,dx+\frac{1}{12}\int_{13}^{25} x(x-13) \,dx}{\int_0^{13} 0.04 \,dx+\frac{1}{12}\int_{13}^{25} (x-13) \,dx}$$
Working this out results in around 19.8 for the final defuzzified tip amount.
This gets us fairly close to the more accurate estimate from the figure in step 2, but it's not exactly the same since I have not accounted for the small excluded areas on the sides of the distribution. However, this still should give an idea of the process they are using to calculate this value.