Yes, your farm loss and long term capital gains will each be included in calculating your total taxable income, so ultimately they do offset each other.
Here's more info on How Capital Gains are Taxed.
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"