As correctly pointed out by Dilip Sarwate, the Fourier coefficients apply to the periodic continuation of your triangular function. However, they are also samples of the continuous Fourier transform of the original (non-periodic) triangular function. So the Fourier coefficients can also be used as a discrete approximation of the spectrum of the non-periodic function.
Let's now have a look at the formula for the coefficients. As you know, there are two representations for the Fourier coefficients. I learned them in this form:
$$f(t) = \frac{a_0}{2} + \sum_{n=1}^{\infty}\left (a_n\cos n\omega t + b_n\sin n\omega t \right )$$
$$a_0=\frac{2}{T}\int_{-T/2}^{T/2}f(t)dt,\;
a_n=\frac{2}{T}\int_{-T/2}^{T/2}f(t)\cos n\omega tdt,\;
b_n=\frac{2}{T}\int_{-T/2}^{T/2}f(t)\sin n\omega tdt,\; n\ge 1$$
with $\omega=\frac{2\pi}{T}$, where $T$ is the period of the function $f(t)$. The other representation uses complex coefficients:
$$f(t) = \sum_{n=-\infty}^{\infty}c_n e^{jn\omega t}$$
$$c_n=\frac{1}{T}\int_{-T/2}^{T/2}f(t)e^{-jn\omega t}dt$$
Let's first calculate the coefficients $a_n$ and $b_n$. We can immediately note that $b_n=0,\; n=1,2,\dots$ because the function under consideration is even. With $T=1$ we get
$$a_0=2\int_{-1/2}^{1/2}f(t)dt=\frac{1}{2}$$
Note that according to the definition I use, the DC component is $a_0/2=1/4$. For $a_n,\; n\ge 1,$ we have
$$a_n = 2\int_{-1/2}^{1/2}f(t)\cos 2\pi n tdt =
4\int_{0}^{1/2}f(t)\cos 2\pi n tdt =\\
=4\int_{0}^{1/2}\left (\frac{1}{2}-t\right )\cos 2\pi n tdt =
2\int_{0}^{1/2}\cos 2\pi n t dt -
4\int_{0}^{1/2}t\cos 2\pi n tdt$$
Due to symmetry, the first term is zero. The second term can be obtained by integrating by parts:
$$a_n = -4\int_{0}^{1/2}t\cos 2\pi n tdt = \frac{1-\cos n\pi}{(n\pi)^2} =
\frac{1-(-1)^n}{(n\pi)^2}$$
For the complex coefficients we get
$$c_n=\int_{-1/2}^{1/2}f(t)e^{-j2\pi n t}dt =
\frac{1}{2}\int_{-1/2}^{1/2}e^{-j2\pi n t}dt - \int_{0}^{1/2}te^{-j2\pi n t}
+ \int_{-1/2}^{0}te^{-j2\pi n t}$$
Again, the first term equals 0 due to symmetry. Combining the other two terms yields
$$-\int_{0}^{1/2}t\left ( e^{j2\pi n t} + e^{-j2\pi n t} \right )dt =
-2\int_{0}^{1/2}t\cos 2\pi n t dt$$
which, apart from a factor 2, is the same integral as above for $a_n$. So we get
$$c_n = \frac{1-\cos n\pi}{2(n\pi)^2} =
\frac{1-(-1)^n}{2(n\pi)^2}\tag{1}$$
The value $c_0$ can be obtained from
$$c_0 = \int_{-1/2}^{1/2}f(t)dt$$ but it can also be obtained from (1) by calculating the limit $n\rightarrow 0$:
$$c_0 = \lim_{n\rightarrow 0}\frac{1-\cos n\pi}{2(n\pi)^2} = \frac{(n\pi)^2}{4(n\pi)^2}=\frac{1}{4}$$
where I used the Taylor series expansion of $\cos(x)$ at $x=0$.